You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
I have a GET request for which response contains few fields only in few scenarios. I would like to make a new request after the response from the first request if some of the fields is present.
I assume condition is the correct code block to use , But when the first request is selected and if we use the save as example for both the kind of response one which contain the fields and another without it , the condition block only picks one of the example and can't access the required field.
Can you please let me know how to first check if the field is present in the response body and then do the check. { "count": 1, "devices": [ { "field1": "1479193213", "field2": "ConnectionReady", "field3": "None", "field4": "2022-02-08T03:24:56.342999Z", } ] }
Same request when there is error: { "count": 1, "devices": [ { "_error": "device_does_not_exist" } ] }
In the condition block i need to check if _error field is present .
Please let me know if this is the right way to use condition block or is there any other block which i can use.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi ,
I have a GET request for which response contains few fields only in few scenarios. I would like to make a new request after the response from the first request if some of the fields is present.
I assume condition is the correct code block to use , But when the first request is selected and if we use the save as example for both the kind of response one which contain the fields and another without it , the condition block only picks one of the example and can't access the required field.
Can you please let me know how to first check if the field is present in the response body and then do the check.
{ "count": 1, "devices": [ { "field1": "1479193213", "field2": "ConnectionReady", "field3": "None", "field4": "2022-02-08T03:24:56.342999Z", } ] }
Same request when there is error:
{ "count": 1, "devices": [ { "_error": "device_does_not_exist" } ] }
In the condition block i need to check if _error field is present .
Please let me know if this is the right way to use condition block or is there any other block which i can use.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions