Comparing numbers in Flow Designer worked like comparing strings?

Annemie Coucke
Kilo Contributor

Hi,

In Flow Designer I was testing an IF-statement where Expenses Record.Amount (type = Floating Point Number) value 25 should have been "<100". But unexpectedly the 25 was seen as higher than 100. When I changed the 100 into 300 it tested OK: the 25 was seen as less than 300. Which suggests the system thought that it was comparing strings. Any idea?

Kind Regards,

Annemie

 

6 REPLIES 6

SanjivMeher
Kilo Patron
Kilo Patron

Even if it is Floating, can you just try compare it like Number(expense record amount)<100 or ParseInt(expense record amount)<100


Please mark this response as correct or helpful if it assisted you with your question.

Annemie Coucke
Kilo Contributor

Hi Sanjiv, thanks for trying to help!

Well, actually, the point is that I was just following a ServiceNow-offered test in "Flow Designer" in Kingston ("Expenses Getting Started", https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/administer/flow-designer/task/getting-started-flow.html).

Step 6.c. said: "Set Condition 1 to [Trigger->Expenses Record->Amount] [less than] [100.00]." In step 2.c. the field Amount was created as "Floating point number". When I look at the records in the DB, the amounts are aligned to the right, as numerics should.

So I expected the flow to recognize that 25 < 100, but it didn't. I don't see the point in changing the test itself to make the equation work. I don't see what I might have done wrong, but I also can't believe this would be a kind of bug. I'm still stuck...

 

Annemie Coucke
Kilo Contributor

The amounts in the records were correctly considered numeric after all, the issue was with the amount in the Flow designer's condition builder field.

It helped to add "num()" in the Flow designer field of the condition builder.

find_real_file.png

find_real_file.png

 

 

Good to know, finally it worked 🙂


Please mark this response as correct or helpful if it assisted you with your question.