Managing complete objects in json

Hi! I’m new at postman flows and at this moment i’m trying to get info from severals apis. From one of them i got this workflows, levels and groups

[
[
{
“workflow”: 39,
“description”: “sector de administracion”,
“level”: [
{
“workflow”: 39,
“level”: 1,
“groups”: [
63
]
},
{
“workflow”: 39,
“level”: 2,
“groups”: [
35
]
},
{
“workflow”: 39,
“level”: 3,
“groups”: [
27
]
}
]
}
],
…

from other i got groups and users

[
{
“group”: 25,
“description”: “Grupo 1”,
“users”: [
“User1”
]
},
{
“group”: 24,
“description”: “Grupo 1b”,
“users”: [
“User2”,
“User3”
]
},
…

How can y get some similiat to

[
[
{
“workflow”: 39,
“description”: “Administracion y Finanzas”,
“with_oc”: “0.00”,
“without_oc”: “0.00”,
“level”: [
{
“workflow_level”: 126,
“workflow”: 39,
“level”: 1,
“approvers_quantity”: 1,
“groups”: [
{
“group”: 63,
“description”: “Grupo63”,
“users”: [
“User1”
]
}
]
},
{
“workflow_level”: 127,
“workflow”: 39,
“level”: 2,
“approvers_quantity”: 1,
“groups”: [
{
“group”: 35,
“description”: “Grupo65”,
“users”: [
“User2”
]
}
]
},
{
“workflow_level”: 128,
“workflow”: 39,
“level”: 3,
“approvers_quantity”: 1,
“groups”: [
{
“group”: 27,
“description”: “Grupo27”,
“users”: [
“userGrupo27”
]
}
]
}
]
}
],
…

I need to join those complex objetcs into one! …
I confuse using $map or $merge… I cant do it… I think I need to iterate every json list with foreach but in fact i cant find foreach as a block in postman flows.

Someone can help me please?

thanks a lot!

Do you know how to express this in JavaScript/TypeScript? If so, try the evaluate block with TypeScript mode. There’s a little drop down arrow in the top right of the evaluate block to change the input language.

@miguelpeccin

Adding similar post with TypeScript and FQL solutions :slight_smile:

Let us know if you get stuck on anything.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.