Hello everyone!
I'm trying to save Facebook Ads API data in my database, specifically the values from the "actions" array. The challenge is that the action_types can come in any order.
Here's an example of the API response:
{
"actions": [
{
"action_type": "page_view",
"value": "123"
},
{
"action_type": "purchase",
"value": "45"
},
{
"action_type": "initiate_checkout",
"value": "67"
}
]
}
I tried to use this expression to save to the database but got an error:
{{actions[?(@.action_type=='page_view')].value || 0}}

Error message:
"Lexer Error: Unexpected token "@" at column 10 in expression"
What's the best way to:
Find specific action_type values regardless of their position in the array
Save these values in my database columns
I need to get:
page_view value
purchase value
initiate_checkout value
Any help would be highly appreciated!
Thanks in advance!