Explain startsWith() function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 11:03 PM
Hi all,
I have a requirement to check a string field (compare with another field which is on another form) and if it starts with certain word then execute a else if() block.
function onLoad() {
//Type appropriate comment here, and begin script below
var value= g_form.getValue('initiated_from');
if (value=='')
{
g_form.setValue('u_tracking_type',1);
}
else if(value.startsWith("CS")) //
{
g_form.setValue('u_tracking_type',2);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 11:15 PM
Hey,
Didn't hear back on this.
Is your issue resolved? If yes, feel free to mark helpful/correct, so it will be helpful for others looking for similar query.
Aman Kumar