profile script includes method not working

Avatar

Avatar

gaureshk3014423

Avatar

gaureshk3014423

gaureshk3014423

06-01-2021

Hi community,

I tried using 

.includes()

.indexOf()

.endsWith()

To check if string contains certain word in profile script but none of above is working in profile script..

Can anyone suggest alternative method to check if string contains particular word in profile script??

 

Thanks

Gauresh

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

zach_shearer

Avatar

zach_shearer

zach_shearer

11-01-2021

What errors are you seeing? I have the following profile script saved and it was working last I checked. 

 

var viewedPageGroup_pageGroupName = user.get('viewedPageGroup_pageNameGroup') || 0;
if (page.url.toLowerCase().indexOf('www.domain.com/page-name/') > -1) { 
    return true; 
}

Avatar

Avatar

surebee

Employee

Avatar

surebee

Employee

surebee
Employee

15-01-2021

Hey @gaureshk3014423, how is it going on this issue? Were you able to get it working? Let us know!