Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

profile script includes method not working

gaureshk3014423
Level 8
Level 8

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

 

1 Accepted Solution
LordOfTheRings
Correct answer by
Level 6
Level 6

Hi @gaureshk3014423  includes() works for me

View solution in original post

3 Replies
zach_shearer
Level 3
Level 3

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; 
}
surebee
Employee
Employee

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

LordOfTheRings
Correct answer by
Level 6
Level 6

Hi @gaureshk3014423  includes() works for me

View solution in original post