Parse error if endpoint returns 200

Hi! I have this query that is executing properly.

If success == false, I need to show the error that it is on the payload. I can not find a way to get that so I can create the condition.

{{ update_item.data.success == false }}

Seems not to be working. Not sure if I am missing something.

Thanks.

You should use the event handlers in the General tab of the query panel... and use utils.showNotification()

There are other ways you can handle errors as well

1 Like

@ScottR

Still, I can not access the response. Am I doing something wrong? I would like to use {{ !update_item.data.success }} as 'Only run when' and {{ !update_item.data.message }} as description.

It seems the response is not available on failure. Data should not be null, I see the response behind the popup. Am I missing something?

Try
{{update_item.data.success === false}}
you have an extra . at the end in the first screenshot.

Hey there!

Just want to add a little context here:

The failure handler shouldn't run no matter what unless the query itself fails. You should be able to set the failure condition in the "Response" settings as you had it by referencing {{ data }} instead of {{ update_item.data }} (see the docs @ScottR linked for reference):

Otherwise, you can add two separate 'Success' handlers that run under different conditions (one for a true success and the other for a success that should be seen as a failure):