Execute a certain API if response field contains a null value

Hi, currently I’m in a situation where I want to execute a certain API based on output

{
    "session": {
        "id": "Id"
    },
    "at": null,
    "rt": {
        "refreshToken": "Token"
    },
    "error": null
}

Usually at at field it would return a token, but sometimes it does return a null too. Currently I am using this check to get the value as:

.check(jmespath("at").saveAs("accessToken"))

I am looking for a way to see if the check fails (etc field return null or any other reasons) then I will execute a certain API based on that, currently I was looking at doIf but it seems that check does not return a boolean, is there a way I can achieve this ?

Hi @trinp,

Did you tried:

Does that help?

Cheers!

Hi @sbrevet , it works like a charm ! Thanks a lot :heart_eyes:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.