
Announcements
Hi guys,
I need help in appending an object variable inside a Apply to each action and then later append that object variable to an array outside of an apply to each. I do not have a clear picture of how to achieve this. Can you guys help me out in this.
Hi,
I believe you can achieve this using the Append to Array step and addProperty function (assuming you want to add a key value to an object).
Here's an example I've built:
Steps:
Array: Some objects with dummy data.
Parse JSON: Using the Array content in order to be able to go through each item later in the Apply to each.
Empty Array: So I can populate the new array according to the condition I've defined inside the Apply to each.
Apply to each: I'm going through each object and performing a condition, If it's true then I'm using the addProperty function to add a property to the object and then populate the empty array (through Append to Array step) with the new object data. If it's not true, then I'm leaving it the way it was before and appending the same object data with no new property.
If you have any additional questions feel free to ask 😀
If this post helps you with your problem, please consider marking it as Accepted solution.If you like my response, please give it a Thumbs Up 👍
Thanks,
Tiago