Hey Nevil,
Here is how I look at this.
{
"client_id": "{{queryPlaidConfig[0].client_id}}",
"secret": "{{queryPlaidConfig[0].secret}}",
"access_token": "{{queryGetToken[0].access_token}}",
"start_date": "{{$_POST.start_date.formatDate(\"Y-MM-dd\")}}",
"end_date": "{{$_POST.end_date.formatDate(\"Y-MM-dd\")}}",
"options": {
"count": "{{batch_size}}",
"offset": "{{offset}}",
"account_ids": "{{queryGetAccounts.groupBy('account_id').keys()}}"
}
}
The entire block above needs to end up as valid json for it to work, and further it has to be what is expected by the api.
So the single braces (shown here in white) are a part of that json.
The paired sets of left and right curly braces basically say “evaluate what is between us and replace everything (in cluding the curly braces) with what we return”.
Some of those evaluations will result in text strings, and some (not all) will be arrays. And if an array, it will by definition be enclosed with square brackets.
In my example, {{queryGetAccounts.groupBy(‘account_id’).keys()}} will return [123,456,789] which we can see matches the format your json is expecting for key_names. Don’t get too hung up on my groupby and kets formatters as that is just one specific way to get an array.
Yours will be something like this:
[
{
"client_id": {{client_id}},
"table_name": "customers",
"sequence": 1565881320,
"key_names": {{your_query.data.array}},
"data": {
"id": {{data_id}},
"name": "{{data_name}}"
},
"action": "upsert"
}
]
You will have to replace my examples with your actual names and choose when something is static (no curly braces) and what is dynamic.
–Ken