Hello, new to retool, but not new to development. I'm starting with a very simple project, just pulling some json from a rest api, and iterating through it and calling another webhook. I don't have a problem pulling the json, but I can't seem to iterate through the data. Here's the json that I'm getting (I just need to get the data.details.output for iteration):
{"data":{"code":"success","details":{"output":"[{"function_id":"4351129000110369100"},{"function_id":"4351129000110363159"}]","output_type":"string","id":"483740000003966023"},"message":"function executed successfully"},"metadata":{"status":200,"statusText":"OK","request":{"url":"https://www.zohoapis.com/crm/v2/functions/get_unrun_async_calls/actions/execute?auth_type=apikey&zapikey=1003.XXXXXXXXXXXXXXXX.XXXXXXXXXXX","method":"POST","body":"{}","headers":{"Content-Type":"application/json","User-Agent":"Retool/2.0 (+https://docs.tryretool.com/docs/apis)","ot-baggage-requestId":"undefined","x-datadog-trace-id":"5223809179723930273","x-datadog-parent-id":"8474434022758973577","x-datadog-sampling-priority":"-1","traceparent":"00-0000000000000000487eb2c5a3de9aa1-759b3cd81f088089-00","tracestate":"dd=s:-1","X-Retool-Forwarded-For":"35.90.103.132"}}}}
Here's the javascript I'm using to iterate:
const results = [];
for (const [index, value] of get_unrun_async_calls.data.details.output ) {
const result = call_async_function_lambda.trigger();
results.push(result)
}
return await Promise.all(results)
For some reason, it returns an array of null values: [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
What am I missing????
THanks in advance!