Create "variable of variable" from webhook payload (mapping path)

:bullseye: What is your goal?

Mapping set of multiple variables from different data root payload

:thinking: What is the problem & what have you tried?

I want to map the exact same set of variables coming from the exact same bundle, with the unique difference that the mapping root is not the same (look at the attached screenshots) :

  • {{1.workflow.children.children}}
  • {{1.payload.workflow.children.children}}
  • {{1.payload.job.workflow.children.children}}

I tried to create a variable of those variable roots but it didn’t work. In other words, I tried to get “payload.job.workflow” or “payload.workflow” or “workflow” depending on my input flow.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

0-Mission-terminée-Kaze-Plomberie-Storing-Make-11-26-2025_04_11_PM.pdf (61.8 KB)

Make doesn’t allow truly dynamic mapping paths (you can’t build {{payload.job.workflow}} on the fly). Best fix is to standardize the JSON first (Parse JSON / Set variable) so you always map from one stable path like workflow.children.children.

Thank you @Moid_shaikh I see and what is the best way to “standardize the JSON” according to you?

Hey Garry,

what’s the problem exactly? The data is supposed to come as one of the three variables, but you don’t know which one it is?

If that is the case, you can have a nested ifempty() function that checks one, if its empty, checks the second and keeps going until one variable returns an output.

Also your map() function in the attached PDF is wrong. The first argument should be an array.

Yes, you’re right and I know actually that a nested ifempty() would work but I would use a big (and ugly) condition that looks something like :

{{ifempty(first(map(first(map(48.workflow.children.children; “children[1].children”; “id”; “info_client”)); “data.value”; “id”; “prenom”)); ifempty(first(map(first(map(1.payload.workflow.children.children; “children[1].children”; “id”; “info_client”)); “data.value”; “id”; “prenom”));first(map(first(map(1.payload.job.workflow.children.children; “children[1].children”; “id”; “info_client”)); “data.value”; “id”; “prenom”))))}}

While I could use something like (if possible) :

first(map(first(map(1.{{payload.job.workflow}} OR {{payload.workflow}} OR {{workflow}}.children.children; “children[1].children”; “id”; “info_client”)); “data.value”; “id”; “prenom”))

Which is much more beautiful :slight_smile: I hope you agree

And yes, I can create a simple input to create this condition {{payload.job.workflow}} OR {{payload.workflow}} OR {{workflow}}

Oh no, you do the ifemtpty() on the array inside the map() function, not on the entire thing.

So something like:

first(map(first(map(ifempty({{1.payload.job.workflow.children}};ifempty({{1.payload.workflow.children}}; {{1.workflow.children}}));

You’re right. I event didn’t think about that, that’s why I posted to clear my mind :wink: I’ll test it thank you