- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
In flow designer i am using an "if" condition and compare two values between catalog variables with values in a table.
I have fetched the values of both catalog as well as table using "get catalog variables" and "look up record" actions respectively.
In table, one of a field is having integer value with commas " , " in between the number.
Catalog variable is a user selection field. It is having a reference details button ( i ) symbol to the left of it. I was comparing one of a field from the reference details section. This field value is integer without any commas.
In the table that i am comparing to, the same field is having commas " , ". This field value is also integer but with commas.
How can i compare this in flow's " if " condition?
If the value is different, then only the next action should be triggered, but here it is going to trigger always even though there is no difference practically. I just want to trim the integer.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Do this
1) create a flow variable of type integer
2) then use "Set Flow Variables" flow action and store integer i.e. convert string to integer using parseInt
3) then use this Flow variable in your IF flow logic
OR
you can use Transform functions in flow
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Do this
1) create a flow variable of type integer
2) then use "Set Flow Variables" flow action and store integer i.e. convert string to integer using parseInt
3) then use this Flow variable in your IF flow logic
OR
you can use Transform functions in flow
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
like this, also attached the gif to post
var numString = fd_data._1__get_catalog_variables.my_number;
var cleanedString = numString.replace(/,/g, '');
// Convert the cleaned string to a number
var result = Number(cleanedString);
return result;
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you for your quick responses.
Any idea on which transform function i can choose? I feel like transform function is easy to configure. I am trying different transform functions to look when it would remove the commas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The transform function "Trim" worked like a charm.
