We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

PrashantLearnIT
Tera Sage

Hello Everyone,

 

Tired of writing hundreds of field level ACLs on a table to control access?

 

Here is the solution: By using special variable root_rule we can achieve this. root_rule stores all field names as value which you can use for building conditions as per your need.

 

Step 1. Write only one table.* ACL.

Step 2. Use special variable root_rule to access all the fields from that table in ACL Script. Sample below.

Var columnName = root_rule.split(‘.’)[1];    //root_rule automatically picks up all the columns from the current ACL as tableName.columnName

Step 3. Now, use columnName variable defined in Step 2 to control the access like below.

If(columnName.indexOf(‘<fieldname>’)) answer = false;

Else answer = true;

 

If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL

 

Best Regards,

Prashant Kumar (LearnIT)

 

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635