I'm working on a similar issue. This is email tracking data and the provider webhook fires every time an email is opened. However, it includes an array called "recents" that has the recipients email client in it. However, that array sends back all recent opens, and the table in the QB app is a log table that's only concerned with the most recent event. I tried to follow Jeremy's suggestion above about just using the array node for the data we're after, but I got an error that said Invalid JSON records location: '/deltas/object_data/metadata/recents'
Here's the sample schema for the first iterate step:
{
"deltas": [{
"date": 0,
"object": "metadata",
"type": "track.type",
"object_data": {
"namespace_id": "text",
"account_id": "text",
"object": "metadata",
"attributes": null,
"id": "text",
"metadata": {
"sender_app_id": 0,
"thread_id": "text",
"reply_to_message_id": "text",
"timestamp": 0,
"from_self": true,
"link_data": [{
"url": "text",
"count": 0
}],
"recents": [{
"ip": "text",
"user_agent": "text",
"timestamp": 0,
"link_index": 0,
"id": 0
}],
"message_id": "text",
"payload": "text"
}
}
}]
}
For that step I didn't specify a JSON Records Path and it's working fine.
For the next one, the source is still the incoming JSON request in the trigger, but the sample schema is:
{
"ip": "text",
"user_agent": "text",
"timestamp": 0,
"link_index": 0,
"id": 0
}
and I put /deltas/object_data/metadata/recents as the JSON records path.
The most recent email open is the last object in that recents array, so I was hoping to use this as a conditional in the for each loop to capture just the last object:
{% for item in d.recents %}
{% if loop.last %}
TRUE
{% endif %}
{% endfor %}
I haven't gotten far enough to see if it will work.
Thoughts on the "Invalid JSON records location: '/deltas/object_data/metadata/recents'" error?
------------------------------
Daniel Johnson
------------------------------