Hi there!
I am having a lot of trouble getting the following filter to work.
Context: I am making an API call that returns a list of messages.
I want to filter only the items on the following fields:
- metadata.event_type=“hardCodedString”
- metadata.event_payload.field=“{{value}}” <= value is (supposed to be) a string
A few notes:
- some items do not have a "metadata" field.
- some items do not have the "event_payload.field" field.
Here is the expression I am currently using:
{{#webResponse.body.messages}}
{{#if(equals(metadata.event_type, "hardCodedString"))}}
{{#if(equals(metadata.event_payload.field, value))}}{{ts}}| {{/}}
{{/}}
{{/}}
Since the field “value” is unique (from a business perspective), I should only get one result or none at all.
However, I regularly end up with inconsistent results: items without metadata, items where the event_type does not match, and items where the field value (within event_payload) does not match.
Does anyone have any idea where the problem might be coming from?
Thanks!