V
V3w ago

Data Transformation

Hi all. I have a generated json, which has children, and some children might also have children. I created a loop, to iterate through them, as I also need to update those children, by adding new key value to them, separated by switch case, based on child type. So question is, how can I get final, updated data? If this was JS code, I would use recursive function, or reduce, to have new updated data, or with foreach modify original data. But I can't figure it out on here. I looked through documentation, and videos but couldn't find anything like this
3 Replies
AI Support
AI Support3w ago
AI Support Bot Information
<@699325537612726394> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
AI Support
AI Support3w ago
AI Response
It seems I couldn't find specific documentation within your files on how to handle recursive updates for JSON structures using loops and switch cases in BuildShip. For such tasks, a common practice is to use recursion, where you would iterate through each level of children, update them based on their type using your switch case logic, and then either update the original object or build a new structure. This aligns with how it would typically be done in JavaScript or similar programming environments. If you are trying to achieve this in a no-code or low-code environment like BuildShip, you might need to utilize the platform's features for loops, switches, and any scripting or custom function nodes that allow you to inject logic. Unfortunately, without more specific steps available, I would recommend checking BuildShip's community or support options for more detailed guidance, or consider using in-app support options to get help from an expert directly. For now, you can explore the available node documentation and examples in BuildShip to see if there are utility or scripting nodes that can help you implement recursive logic in your workflow【4:0†buildship-support-site.json】.
BuildShip AI Support
Chris Wright | AI & Apps
Sounds like you need a custom node to format the data, just add an "empty node" and customise it with your JS knowledge or prompt the built in AI to start writing it for you.

Did you find this page helpful?