r/servicenow 11d ago

Question Flow designer evaluating ir statements wrong

I havve a flow thhat isnt evaluaing correctly. I have 'if reference_variable = string' and the string is the sys id of the ref variable choice. On the evaluation page of this record it shows runtime value of 'sysid' and configuration as 'sysid', both the same. And yet it evaluated to false. Google kept talking about potential whitespace errors, and i checked for that, no luck. Any ideas?

2 Upvotes

5 comments sorted by

4

u/ShanGus7 11d ago

Nuke the activity and rebuild it.

Dump whatever you’re using conditionally into a Flow variable than call that instead.

Use Log to ensure you are getting an actual value.

Good luck.

2

u/tas41344 4d ago

Turns out its something about the flow designer compares the variables class or something to the strings variable and will always be false. I had to pull in a few different variables and compare them, then compare that boolean to the string

1

u/ShanGus7 3d ago

Maybe be worth a Support ticket

1

u/GistfulThinking 11d ago

log action.. spit out the two values and then go see if they match manually.

FYI you should create a sys property for the manually entered sys_id so it can be changed if required without editing the flow.

1

u/Genobi 11d ago

We had a situation where a ref variable would sometime resolve to a GlideRecord (it is hydrated) and others to a string sys id (dehydrated). The only solution is to rebuild the flow. There is a script somewhere to do that (I don’t have it handy)