09-02-2021 06:05 PM
Hi,
I have to route based on the output type using router snap.
Route to port 1 if output is string , to port 2 if output is number.
How to I do that? Thank you.
Solved! Go to Solution.
12-09-2021 06:06 PM
But if those numbers are between quote it means that it is string.
723456 and “723456” is not same.
See if this will help you to determine if it’s number or string.
$input.toString().match(/^\d+$/) != null ? true : false
This expression will check if value of input contains only numbers and if it is, then will return true, otherwise if not contains only numbers it will return false.
To check for string it’s opposite, you need to switch the places of true and false.
Regards,
Viktor
12-09-2021 04:55 PM
Hi @viktor_n ,
even typeof 723456 is coming as string.
12-09-2021 06:06 PM
But if those numbers are between quote it means that it is string.
723456 and “723456” is not same.
See if this will help you to determine if it’s number or string.
$input.toString().match(/^\d+$/) != null ? true : false
This expression will check if value of input contains only numbers and if it is, then will return true, otherwise if not contains only numbers it will return false.
To check for string it’s opposite, you need to switch the places of true and false.
Regards,
Viktor