Get information from parent

Hello the community :slight_smile:

I have a problem during flatening to also have the info from the parent data.
Long story short, i have a structure that looks like


and I want to set a variable to get all the tickets, i successfully got it thanks to this part:

formula: {{flatten(map(93.level_1; “tickets”))}}
=> my issue is that i would like while flatening the tickets to keep the data from the parent part:
So for example i have: id: 80625297 tickets [ name: 123 value: 50] [name: 234 value: 100]
=> the flatten structure would have 2 lines:
id: 80625297 name 123 value 50
id: 80625297 name 234 value 100.

All I’m trying is or not flatening well my structure, or giving the same id to all the lines ( as it’s in a n array )

hope you’ll be able to help :slight_smile:

You’ll have to use an Iterator-Aggregator.

This is because by using the map function, you are selecting/extracting ONLY the tickets information from the array, and discarding the rest of the parent data.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

Hello Samliew,

thanks for the reply, the reason why i did’nt use the iterator in this specific case is that I have 1000’s of tickets and each execution was taking me 1000’s of operations, which is a lot for a daily process…
That’s why I used a setvariable to recover the data, and was wondering on a formula to agregate the 2 fields of the parent that interest me to have all together.

Looks like you’ll benefit from actually running some code, so that you can complete all of this in a single module.

Usually when I want to run JavaScript, I’ll use one of these modules:

1. Dumpling AI “Run Javascript Code” module

2. @samliew’s “Execute JavaScript” module

Demo: Remove empty keys/variables from data - #8 by samliew
Install: [Free App] My Toolbox of Useful Modules

Hope this helps! Let me know if there are any further questions or issues.

— @samliew