- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:35 AM
Hi,
I need to check if a Request Item variable (vendor part number) contains a number - this could be made up of letters, numbers or a combination of the two.
I'm fairly new to Flow Designer and wondering how best to achieve this?
The if flow logic doesn't seem to allow for scripting in order to check for a number.
There are some subsequent decisions based on looking up values in a table so I wondered if 'Make a Decision' would be the correct route?
Many thanks,
Clare
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 06:23 AM
Hi,
A bit of a clumsy solution would be to check if the input contains any of the numbers you are checking for.
See attached image below.
I made a little research, to see if it would be possible to build a smarter solution using regex to match for a given pattern instead, but it doesn't seem like this is possible OOB.
In that case you will need to build your own custom action that does this, a good example can be found on YouTube
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 06:12 AM
that's correct.
you need to create custom action; pass the variable value as input and inside that input add script to check if the value contains a number and return boolean true/false
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 06:23 AM
Hi,
A bit of a clumsy solution would be to check if the input contains any of the numbers you are checking for.
See attached image below.
I made a little research, to see if it would be possible to build a smarter solution using regex to match for a given pattern instead, but it doesn't seem like this is possible OOB.
In that case you will need to build your own custom action that does this, a good example can be found on YouTube