Possible to return nested data from API?

I’m looking to Return data from API in a certain json format.

Basically I have users with an “ID”, as well as a variable in user containing the users “duties” as a list, each with it’s own “ID”. How would I go about returning such that it looks like:

{
   "users": {
      "1": ["2142", "5235"],
      "2": ["3241"].
      "3": ["2944", "2314", "0323"]
   }
}

This is what I have now but I don’t know how to move on from here…
image

From my understanding, it would be something like (search for users)-each items id, joined with said users duties list-each item id

I can’t get it to work…

you have to build the structure here. i suggest use plan text.
create a body:

{
 Search for User  : Format as text // this will give you a list of user
}

inside each user, create an array [] inside it list the duties.

and when you use fotmat as text for duties, inside it will give you another window for Format content as text inside it use double quote "" for duties name and use comma for delimiter ,

if with Content-type as plain text not working, then user Other content-type and use application/json as value for other custom type.

i will be free in an hour if you want i will walk you how to do it.

2 Likes

Thank you so much!