issues with IF branch and currency field in flow designer

Elena Spıru
Mega Guru

Hello, 

 

On my form I have a currency field ('Amount') and in the Flow Designer I added an IF branch. I have different scenarios such as:

 IF

(Amount) GREATER THAN or is 100000

(Amount) LESS THAN  150000

{do stuff}

 

ELSE IF

(Amount) GREATER THAN 500000

{do stuff}

 

The problem is that when logging the value from the currency field it is retrieved as e.g. 140.000,00. So my IF statement is returning FALSE even if it should retry TRUE. I've tried also with num(100000) but i get the same issue.

 

1.jpg

 

I can't script anything in the IF action so really not sure where to go from here.

Any ideas?

 

Thank you,
Elena

1 ACCEPTED SOLUTION

Elena Spıru
Mega Guru

Solution found! Found out that the IF statement converts the currency field into a string, so with fx->string->convert string to number solved the issue.
2.jpg

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Elena Spıru 

you can use flow variable logic

How to configure an if condition for 'is greater than' in Flow Designer? 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I've tried, but type is decimal and it won't work in my case.

 

Viraj Hudlikar
Tera Sage
Tera Sage

Hello @Elena Spıru 

 

Did you tried to apply function on field value you are comparing with your constant values. See example below, In this example I have click on fx button in condition input field and then use Math->Absolute Value to compare or you can use which suits your requirement.

VirajHudlikar_0-1762955885584.png

 

If my response has helped you, hit the helpful button, and if your concern is solved, do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Hello,

 

Exactly, I just discovered it and it worked like magic! I used the Convert String to Number and tested all scenarios -> All successful!

2.jpg