I’m using the Twitter integration, and I’m querying for some particular tweets.
I then apply a Filter to the tweets returned, to check only tweets that contain an image.
I use an Exists condition to only continue the workflow if that condition is met.
In the case of my image, I check that the following key exists:
SyntaxError
Unexpected token h in JSON at position 0
The value in that key is just a string.
And since it’s a link to an image stored on Twitter, it’s a string containing a URL, which of course starts with an h.
For example, a value in that field is: https://pbs.twimg.com/media/FRCIzy0WQAEC668.jpg
Does the filter assume that the key’s value needs to be some JSON object or array? So it’s not possible to check for the existence of a value?
I haven’t been able to find the documentation on Filter to better understand how to create my exist condition. If you can point me at the right direction, I’d be grateful.
Thanks in advance for your help.
Now, if the steps.trigger.event.entities.media array doesn’t exist at all, instead of throwing an exception, the result will return undefined which the Filter should be able to handle.
@sysadmin thanks for the screenshot, can you also share a screenshot of the value of the steps.trigger.event.body.payload?
I suspect that this particular variable is a string or some other non JSON serializable format.
If it is a string, then I suggest adding a Node.js or Python code step to convert it into JSON, then you’ll be able to use a Filter to read the individual attributes on the object.