Server action - convert json to array

Hi community,

I have a nested json submitted to server-side by client-side form made up of hidden input fields. The format of the json is like this:

myEmployees: [
        { name: "John", role: "Analyst"},
        { name: "Kate", role: "Manager"},
        { name: "Jack", role: "Assistant"},
        { name: "Tom", role: "Contractor"}
]

I want to extract the names as an array like below, and use this further for further processing.

[“John”, “Nick”, “Jack”, “Tom”]

Any idea how to do this? I did try running the json through a repeat, and assigning the names to another variable and outputting it prints both key-value pair, not just the value.

Wish json & array processing was simpler and easy in wappler on server side, it has always been a mystery! Any help will be very appreciated!

Community Page
Last updated: