
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:06 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:09 AM - edited ‎01-29-2025 02:11 AM
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')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 02:30 AM
Thanks for your correction! I appreciate this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:16 AM
Thanks all for your replies, the solution was -
current.correlation_display.startsWith('MSFT')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:19 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader