loop not parsing the array properly

i am passing a array as a value in a loop but it is taking it as a single value not parsing it properly ( the array which i am passing is not nested) here is the link my workflow please check it - https://app.buildship.com/remix/98d6edf0-a403-4dec-bd91-f3ebd6216a10 please help me as i desperately need asolution
BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
No description
No description
No description
Solution:
@Gaurav Chadha @Chris Wright | Because You Can Thank you brother for you help i finally 😊😊 founded the issue ( i was adding an array inside items in the loop ) that's why it was self nesting it
Jump to solution
11 Replies
AI Support
AI Support2mo ago
Processing...
🤖 Calibrating response parameters. 🎛️ this might take a couple of minutes... beep boop
Chinmay Khandelwal
Chinmay KhandelwalOP2mo ago
can someone human help me please i already tried solutions provided by bots like these
Chris Wright | Because You Can
I think the loop node is expecting an array of objects, so if you wrap each doc.id it should work... CollectionQuery?.map(doc => ({ id: doc.id }))
Chinmay Khandelwal
Chinmay KhandelwalOP2mo ago
no brother this also not working , please see the input of collection query you will get the idea @Chris Wright | Because You Can Did you have any other ideas to make it work brother
No description
Chris Wright | Because You Can
Sorry that didn't work, in these cases I often find introducing a custom node before the loop that can take the output of the collection query and format it for the loop helps, so you can simply pass it into the loop as a clean array.
Chinmay Khandelwal
Chinmay KhandelwalOP2mo ago
@Chris Wright | Because You Can Already tried , the loop is not even working properly even when i manually passed an array like this - [ "ACsU6G5uqdbwZM7lmNco4d0FQxu2", "V3RIAYcrqyaEhKQjVUOLG3ottvr2", "hlf1BXax5bdj0lCCa6CeOpTa5532" ] for testing it is considering it as a single value not parsing it
Chris Wright | Because You Can
Yes because the items are strings not objects
Chinmay Khandelwal
Chinmay KhandelwalOP2mo ago
@Chris Wright | Because You Can Ooooo really is that is causing problem can you please explain me more and how can i fix it
Gaurav Chadha
Gaurav Chadha2mo ago
Hi @Chinmay Khandelwal thanks for also sharing this via in-app support, we've sent you an email with the cause and fix, you can followup on email.
Chinmay Khandelwal
Chinmay KhandelwalOP2mo ago
@Gaurav Chadha But when i tried the same thing using an array of documents from firestore query collection it is not working , i even tried .flat() to resolve the nested array issue but still it is not working Please see the attached screenshot i think i am not passing a nested array
No description
Solution
Chinmay Khandelwal
@Gaurav Chadha @Chris Wright | Because You Can Thank you brother for you help i finally 😊😊 founded the issue ( i was adding an array inside items in the loop ) that's why it was self nesting it

Did you find this page helpful?