---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Example - Restrict a field with a script

# Example - Restrict a field with a script {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

This access control prevents everyone from editing an incident with a category of
Software in a list. It is defined by a script.
Figure 1. Restrict Software Incidents

* Type: record
* Operation: list_edit
* Name Incident:\[incident\]
* Admin overrides: Clear the check box.
* Script:

      if (current.category == 'software')
      answer = false;
      else
      answer = true;

{#r_ExampleRestrictAFieldWithAScript__ul_dky_krl_v4}
**Previous topic:** [Example - Restrict a field](https://servicenow-prod.fluidtopics.net/p5eNGS3CF_NwTQpdSGtFnQ "This access control prevents everyone except an administrator from editing the Short Description field of an incident record in a list.")  
**Next topic:** [Example - Restrict a field with a condition](https://servicenow-prod.fluidtopics.net/4l4bONlFD45JJo5fDQFahQ "This access control prevents everyone from editing a Critical Incident in a list. It is defined by a condition.")

