UI Action Condition

Steve29
Tera Expert

Hi All

We have a UI action on the incident table that we need to restrict access to for only records with a correlation_display that starts 'MSFT'.

The condition I'm using is 'current.correlation_display.indexOf('MSFT')==-1' but this is removing the UI action from all records regardless of correlation_display.

Any help would be appreciated

Thanks

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

-1 is when you don't find the string at all, you need to use the below

 

 

current.correlation_display.toString().indexOf('MSFT')==0

 

OR Simply

current.correlation_display.startsWith('MSFT')

 

 

-Anurag

View solution in original post

7 REPLIES 7

Thanks for your correction! I appreciate this.

Steve29
Tera Expert

Thanks all for your replies, the solution was - 

current.correlation_display.startsWith('MSFT')

 

@Steve29

Glad to know that the approach I shared worked for you.

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader