- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:23 AM
Hi everyone,
how can i program this better, i want to be able to convert the string into lowerCase and then search for the lowercase sub sting in the If Statement
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:51 AM - edited 02-28-2024 10:51 AM
If condition updated.
make sure the variable afa returning string type value [ not an object type ]
in case, afa is returning Object, then add .toString().toLowerCase();
answer = ifScript();
//
var proBono = current.variables.afa.toLowerCase();
function ifScript() {
if (proBono.indexOf('pro bono') > -1 ) {
return 'yes';
}
return 'no';
}
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:44 AM
Hi @Peter Williams,
You can try with "Advance" section script and use the toLowerCase() method.
var afaValue = current.variables.<afa_variable_name>.toLowerCase(); //replace the correct afa_variable_name
or
var afaValue = current.variables.<afa_variable_name>.toString().toLowerCase(); //replace the correct afa_variable_name
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:46 AM
so would this work then cause i need to check a sub string in a string
answer = ifScript();
//
var proBono = current.variables.afa.toLowerCase();
function ifScript() {
if (proBono.indexOf('pro bono')) {
return 'yes';
}
return 'no';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:50 AM
Ideally this should work.
answer = ifScript();
//
var proBono = current.variables.afa.toLowerCase();
function ifScript() {
if (proBono.indexOf('pro bono')>-1) {
return 'yes';
}
return 'no';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 10:51 AM - edited 02-28-2024 10:51 AM
If condition updated.
make sure the variable afa returning string type value [ not an object type ]
in case, afa is returning Object, then add .toString().toLowerCase();
answer = ifScript();
//
var proBono = current.variables.afa.toLowerCase();
function ifScript() {
if (proBono.indexOf('pro bono') > -1 ) {
return 'yes';
}
return 'no';
}
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution