When I try to work the second result into an object in legacy loops I get an empty array. Can anybody see why?
Secondly, does anybody know how to retain the keys in new loops as you can in legacy by editing the loop code;
const results = ;
for (const [index, value] of query37.data.entries()) {
const result = await query38_lambda.trigger();
results.push({
loop_result: result,
email:value.email,
invoice_id:value.invoice_id
})
}
return await Promise.all(results)
On the first line you have const results = ;
And then on line 4 you have results.push...
Results is not an array so you cannot push into it. So you should start with `const results =
It's possible you have other problems, but that is one of them. I would think you should have gotten an error in the debug console or somewhere.
I guess you deleted that previous post? It might be helpful to post some more screenshots to give us some more context.
When you say "work second result into an object", what does that mean?
Not sure about second part at all. You're looping over tracking numbers, checking some status and kicking off some apis. But what keys do you want to retain?
Hi @John_Hughes! I'm still a little unsure about what you're trying to accomplish here, so it might be helpful to see a JSON export of your workflow in its current form.
Looking at what you have shared, the first thing I notice is that it doesn't make much sense to store anything under a key of info inside the results array. It's likely not related to the behavior that you're seeing, but I thought I'd point it out.
If the results array is ending up empty, I'd first look at query35.data and verify that the value associated with entries is actually an invokable function.