Have you tried doing a recursive API Workflow so that it updates one POSData at a time?
You can have two parameters for the endpoint:
- List of numbers (this is the JS result)
- Number to process (this is a single number from the list)
When you first trigger it (Schedule an API Workflow - NOT on a list), you pass the full list result in param 1 and then the list’s first item in param 2. Since you’re triggering from a page, you should still be able to do :first item
Then the API workflow will make a change to the first POSData with an empty field 3 (sorted by field 1). Field 3 = Number to process
The last action would Scheduled an API Workflow (itself) to run all over again (this is your recursive loop). The updated parameter values:
Param 1 = List of numbers :minus Number to Process
Param 2 = List of numbers :minus Number to Process :first item
Now, the next time it runs, the list only contains unprocessed numbers and it will process the next in the list.
Add a condition to this Schedule action (the one that schedules itself in API Workflows): “Only when List of numbers :minus item Number to Process :count > 0” so that the loop continues as long as there are still items in the list. Once you’ve “minus-ed” all of them away, the count will eventually = 0, failing the condition, and terminating the loop.
Gaby at Coaching No Code Apps (formerly Coaching Bubble)
Courses & Products, Tutorials, Private Coaching, and High-level Development
Start Learning Today
Hey romanmg, thank you very much for this approach! I think this is the right way to go and i would have never thought of it. I implemented this and i think i did it the correct way, but i am not getting any result into field 3 of the POSData items.
- The workflow only runs once. As if the condition in the nested workflow didnt pass, meaning the list is empty.
- If i set the api workflow to make a change to the POSData where Field 3 = number to process, field 3 appears to be empty, but if i set Field 3 = 1 then the field will have its value equal to 1.
Here i attach some screenshots of what i did:
Thanks for your help
Ok, let’s get this figured out:
Are there any privacy rules that might be preventing this from running or perhaps you can try with the checkboxes “ignore privacy rules when running the workflow” checked for both “Schedule” actions?
Check your server logs. It will say what values were passed through and if the condition on the “nested” Schedule action passed or failed.
Also, I do see one minor correction to make (and I’ve updated my earlier description):
condition should be:
ListaJS :minus item ItemListaJS count > 0
Yes, the ListaJS parameter is a number, as seen here:
I tried checking the box for “ignore privacy rules” but i get the same result.
I checked the server logs and they confirm what i was thinking. The values are not passed into the API workflow, which is very weird
I tried what i mentioned earlier:
The values are now added to field 3 of the POSData items but i get a problem, which is that there are no repeated values passed on, meaning if my list is 1,2,2,3,3,3 i only get 1,2,3
Here i attach the screenshots:
Values i need:
As you can see, the values are added to field 3 correctly, but only the unique values, i need all the values to be passed on.
Any help as to what to do is appreciated
I’m wondering if it’s that “passing” of number list that strips out any duplicates.
You could also try passing them as a list of texts to see if that helps and convert the text back to a number within the API workflow (there’s a handy, free, data converter plugin for this).