Add Item data to With Items results
Greg Vinyard
When querying an API or running an action repeatedly using With Items, often the results do not contain information that can associate it with the list you used for the With Items.
For example, I might have a list of id numbers [321, 456, 156]. Then I use With Items to get the names associated with those ids. Now I have a separate results list, ["mary", "bob", "joe"], and I have to merge the two lists together.
It would be nice if I could have the Results output be something like,
[
{
"item": 321,
"result": "mary"
},
{
"item": 456,
"result": "bob"
},
{
"item": 156,
"result": "joe"
}
]
Or even just a single "key" field for each result, if the original "item" is very large.
Log In
Matthew Congdon
This might be more convenient but you can currently use the zip filter to achieve this if that helps.
Example: Assume list1 was used in the with items field and list2 is the collected results
{{
[
{
**list1_results,
**list2_results
}
for list1_results, list2_results in CTX.list1 | zip(CTX.list2)
]
}}
Brian Simpson
If you turn the withitems action in to a subworkflow, you can return this information in the output from the subworkflow