- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2023 06:29 AM
ServiceNow forms in Portal will apply the UI Policy, Client Script and ACL permissions on each field.
I would like to make some fields editable from a list view. And, I would like to build some cleaner forms without ServiceNow Forms.
Is there an api call or a script someone uses that can check if a field is read only for a user applying all of the levels of servicenow?
I see the debugger API returns this:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783470
So, I am guessing there is an function for it.
I would like to check if the field is editable
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2023 08:46 AM
Hi,
In your context, the UI Policy and Client Script may not apply if you handle it all within your form/widget. Those don't necessarily check user permission. You can force that, sure, via script, but that's not the main function. Those just help with the user interactions to make a field display or not, mandatory or not, etc. ACLs would apply to field permission and you can check those via the GlideElements such as canRead() see example here: https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/no-namespace/c_GlideElementScop...
So essentially, you would use the server script in the form to capture all that information, based on the fields, and then within your HTML you can tap into that and use that in an ng-if, for example, to hide or show the field, etc.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2023 08:46 AM
Hi,
In your context, the UI Policy and Client Script may not apply if you handle it all within your form/widget. Those don't necessarily check user permission. You can force that, sure, via script, but that's not the main function. Those just help with the user interactions to make a field display or not, mandatory or not, etc. ACLs would apply to field permission and you can check those via the GlideElements such as canRead() see example here: https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/no-namespace/c_GlideElementScop...
So essentially, you would use the server script in the form to capture all that information, based on the fields, and then within your HTML you can tap into that and use that in an ng-if, for example, to hide or show the field, etc.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 06:14 AM
Allen,
Thank you for your reply. I reviewed the policies I have applied and I am using ACLs for all of the key things. That said, the UI Policies and Client script support setting a field to read only. When using the ServiceNow form in the HTML the scripts get applied. So, while my use case works and I can move more into the ACL if I need to, I just noticed that there may be cases where someone put logic in Policies and/or client script. I suspect that ServiceNow forms are somehow applying even that logic. I was wondering if anyone knew how the angular form object in ServiceNow applies those.