If condition not working with <>

I am using http request to perform rest api get calls storing json deserialize values comparing that using if condition status <> “LIVE” Or status <> “RESERVED”. Seeking your expertise. tried status.trim.tolower <> “live”

This was already answered in your other post. OR is wrong, use AND.

status <> “LIVE” OR status <> “RESERVED”

…this will ALWAYS be true.

Change it to

status <> “LIVE” AND status <> “RESERVED”

Also, alternate syntax is…

(NOT status = “LIVE”) AND (NOT status = “RESERVED”)

status can be live or reserved sir if we use and it wont cater the scenario sir

Again…

status <> “live” or status <> “reserved”

…will ALWAYS BE TRUE. It can NEVER be false.

What is the scenario? Tell me in plain language what you want this condition to do.

I am storing the Deserialize json response to a variable like sts=JObj(“status”).tostring if it is live status or reserved status it should not execute rest api patch call using http request activity

Then your condition should be…

NOT (status = “live” OR “status” = reserved)

And then put your “execute rest api patch call” code into the “then” block of the If activity.

grafik
And also

grafik

grafik

Hi @Sathish_Ashokan

This is already answered in your previous post:

Try this → not (sts.Trim.ToLower.Equals(“live”) or sts.Trim.ToLower.Equals(“reserved”))

The above conditions signifies that, if sts variable holds the value live or reserved → “Then” block of the if condition will not be executed instead the “Else” block will be executed.

again not working madam is it because i am storing json deserialize token value sts=jObj(“resourceManager”)("status)

do i need to add .tostring?

Hi @Sathish_Ashokan

sts variable is of string data type right ?

Could you please share any screenshots if possible ?


This is the screenshot

Hi @Sathish_Ashokan

You are storing the value of jObj(“organizationInformation”)("status) to the variable mcnstatus ?

If that’s the case, you need to replace sts with mcnstatus in the if condition.