Script if value is one of range of IP adresses, how to write condition
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:40 AM
Hello Guys,
I am a bit stuck with understading how to write the condition as i need to check if IP adress was used in a value, but not one or two, one of from 10.24.157.64 till 10.24.157.127. How to write properly this certain information? If value is betweeen 10.24.157.64 and 10.24.157.127.It means it can be 10.24.157.65-66-67-68...etc till 127. I need to check 2 fields source and estination, if they have one of these IP adresses and stuck how exactly to use condition if it is long IP address and not just number.
In workflow in step IF i wrote this:
answer = ifScript();
function ifScript() {
if (current.variables.destination.toString().includes('10.24.157.64','10.24.157.127') == true)
if (current.variables.source.toString().includes('10.24.157.64','10.24.157.127') == true)
{
return 'yes';
}
return 'no';
}
Could you please help?
THANK YOU in advance, TEAM!
Best regards,
Fotina
0 REPLIES 0