- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 04:56 AM - edited 10-28-2022 05:01 AM
Hello.
I have designed a flow and when I try to run it, it fails at if statement.
So, I have used an action to fetch "Token" and "Token Status Code", i.e. if successfully fetched it returns 200(string) as status code,
Now until this part it executes fine, after this it has to evaluate in "if" statement if "token status code" is 200 .
This is evaluated as false by if statement. even though 200 = 200 as evaluated by it in screen shot.
Any help is appreciated.
Solved! Go to Solution.
- Labels:
-
Cost Management (ITSM)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 08:06 AM
Hello @Mahesh78,
I recently had the same issue accross multiple instances (Rome and San Diego).
To me this looks like a serious bug on ServiceNow side but I have not found any official documentation yet.
Basically using String comparisons in if statements is currently not working properly. If you look around the community, you will find more similar questions.
One workaround that worked for me was deleting and creating the if condition multiple times and clearing the cache of the instance in between. If you want to be sure, I would suggest avoing string comparisons. Maybe you can script a solution and return true or false based on the REST message code. Then in your if statement you can compare the boolean value and dont have to comare the String value.
I hope that helped!
Greetings,
Sören

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 08:06 AM
Hello @Mahesh78,
I recently had the same issue accross multiple instances (Rome and San Diego).
To me this looks like a serious bug on ServiceNow side but I have not found any official documentation yet.
Basically using String comparisons in if statements is currently not working properly. If you look around the community, you will find more similar questions.
One workaround that worked for me was deleting and creating the if condition multiple times and clearing the cache of the instance in between. If you want to be sure, I would suggest avoing string comparisons. Maybe you can script a solution and return true or false based on the REST message code. Then in your if statement you can compare the boolean value and dont have to comare the String value.
I hope that helped!
Greetings,
Sören
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 12:57 AM
Hey @Soeren Maucher ,
Thanks for the reply, I followed your suggestion and deleting and creating the statement a few times did the job.
Hope ServiceNow looks into this issue seriously.
Thanks Again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 06:22 AM
Chrome is causing this issue, switch to FireFox.
Not sure if anyone else found this workaround, but Flow Designer has a tendency to corrupt "If" statements when you use Chromium browsers, if you switch to FireFox when using Flow Designer this corruption will not occur.
For a technical explanation when you use Chromium it will insert hex color codes into the background execution script of the "If" statement and that is what is causing the corruption. The hex color code is not visible from the UI, you have to go into the background and look at the actual code.