- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 07:14 AM
Hi everyone!
I have an existing business rule and I need to insert a condition inside the script using "if (current."
Condition : If "user account" field contains "ETC"
Field: u_useraccount
Field Type: string
What I did was this and I know that it's not really correct since I used "==".
if(current.u_useraccount =="ETC"){
}
I'll appreciate if someone respond to this. Thanks in Advance!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 07:20 AM
You can use:
var str = current.getValue("u_useraccount");
if(str.indexOf("ETC") > -1){// checks if u_useraccount contains ETC, indexOf returns -1 if not found, else returns the index where the substring is found.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 05:38 AM
Hi Aman,
Does it work for List type field as well ?