User need to see the record in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 06:08 AM
HI Community,
I have a requirement, there is a table called "cases" in that there is field called external provider (similar to watchlist) when the user is added to that external provider field then the record needs to be visible to the added user (in external provider)in portal.
For that i have created one read acl but it is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 06:19 AM
Hello @suuriyas,
Try below script in ACL
(function() {
answer = false;
// external_provider is a glide list (comma-separated sys_ids)
var users = current.external_provider.toString().split(',');
if (users.indexOf(gs.getUserID()) !== -1) {
answer = true;
}
})();
Please mark my response as Accepted and Helpful for future references.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 06:31 AM
Hi Suuriyas,
Try the below code in your read acl.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 06:35 AM
Hi @suuriyas,
based on Snip, i could see there is some small i would recommend
1. ACL script execution order
ensure record-level Read ACL is set properly
ACLs evalaute properly
a.table.None
b.table.field
so, if you only created a field level ACL make sure the Table level also allows access
2. ACLScript
(function() {
var userId= gs.getUserId();//current logged in user
var fieldValue = current.external_provider.toString();//conver to comma separated string
if(fieldValue.index(userId) !== -1{
answer =true;
}
else
{
answer=false;
}
})();
3. save and test it
login as user added to the external_provider field on case record
you should be able to see that record
Please mark as Correct Answer/Helpful, if applicable.
ServiceNow Developer
Chiranjeevi
ServiceNow Developer | | ITSM | | ServiceNow Discovery | | Event Management | | Service Mapping | | CMDB
Please mark as Correct Answer/Helpful, if applicable.