How to validate length of a string and check if the substring are integers?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 01:06 AM
Hi,
I need this requirement in the condition wherein email subject of inbound email actions contains prefix+8digit number.
e.g. user should add this to subject line: CS00001234
It will pass the condition since it has the prefix (CS) + 8 digit number required. Action is that this will be populated to the custom field in a table.
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 01:18 AM
Hello @Justine Mae Ruf
You can use regular expression for the same.
var str = email.subject;
var regex = new SNC.Regex('/CS\\d{8}/im');
var csNumber = regex.match(str);
gs.info(csNumber);
Thank you,
Ali
If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!
Thank you,
Ali
Thank you,
Ali