Hello! I am using the n8n Set Values node to reason a json and set values or variables using Expression filters. For the most part it is working but in the below JSON I am trying to get the prices raw value of 35 because it is the is_rrp = true value but for some reason I can never get it to work.
Here is an example of an expression I tried:
{{ $jmespath($json.prices, “[?is_rrp==true].value”) }}
but that returns [Array: [29]]
… and I have no idea why!
Any help is appreciated.
Thank you
{
"position": 1,
"title": "Apple USB-C to Lightning Cable (2 m)",
"asin": "asintest",
"link": "https://www.amazon.com/",
"categories": [{
"name": "Electronics",
"id": "electronics"
}],
"image": "https://m.media-amazon.com/images/",
"is_prime": true,
"rating": 4.8,
"ratings_total": 15213956,
"prices": [{
"symbol": "$",
"value": 29,
"currency": "USD",
"raw": "$29.00",
"name": "$29.00",
"is_primary": true
},
{
"symbol": "$",
"value": 35,
"currency": "USD",
"raw": "$35.00",
"name": "$29.00",
"is_rrp": true
}
],
"price": {
"symbol": "$",
"value": 29,
"currency": "USD",
"raw": "$29.00",
"name": "$29.00",
"is_primary": true
},
"page": "1",
"position_overall": 1
}