A data policy in ServiceNow enforces field consistency by making fields mandatory or read-only when defined conditions match. It can protect records submitted through forms, imports, and web services. Configure the table, conditions, field rules, and applicable entry channels, then test both compliant and noncompliant records before enabling broader enforcement.
Choose the field rule before configuring the policy
Start with a specific record requirement: a problem needs Close notes before it reaches Closed/Resolved, or an incident needs Assignment group when Impact is High. Separate the condition that selects records from the action that changes a field’s mandatory or read-only state. This distinction keeps the policy understandable when another administrator investigates a rejected update.
A data policy supports required-field and read-only enforcement. Describe a value requirement in those terms before implementing it. Requiring a populated field does not establish that its contents are accurate, meaningful, or approved. If the business requirement concerns an allowed value or a calculation, first determine whether mandatory and read-only states actually express that requirement.
Record who should supply the field, when it becomes required, and which incoming systems can provide it. Review ServiceNow role-based access control alongside this design when the person responsible for completing a record also needs permission to edit it.
Create a data policy in ServiceNow
The admin role is required to edit data policies. Begin in a controlled test environment with one table and one clearly stated condition. The Table list shows only tables and database views in the same scope as the data policy. Check the settings on your instance and release. The field labels here follow the Brazil release documentation, and the Automated Test Framework example was checked against the Australia release.
- Navigate to System Policy > Rules > Data Policies and select New.
- Select the Table and identify the policy through Short description and Description. Make the description explain the business condition and affected field.
- Build the condition that determines when enforcement applies. For a closure requirement, use the relevant problem state condition rather than making the field required throughout the record’s life.
- Review Active, Inherit, Reverse if false, and the entry-channel options before saving.
- Right-click the header and select Save. The Data Policy Rules related list becomes available.
- Select New in that related list, choose the field and enforcement settings, then select Submit. Add further rules when the requirement needs additional fields.
Keep the first test small enough that a failure has an obvious cause. A policy containing several conditions and several field rules is harder to diagnose than a single closure requirement. Expand it after confirming the initial behavior, and document why each added rule belongs under the same condition.
Set Mandatory, Read Only, inheritance, and reversal
Each rule identifies its Table and Field name. Mandatory and Read Only each offer Leave alone, True, and False. Choose True when the matching condition should impose that state. Leave alone means this rule does not set that state. Choose True or False only when the requirement should change it. Use False deliberately when the requirement calls for that state to be removed.
For example, a rule can set Mandatory to True for Close notes when the policy’s closure condition matches. Keep Read Only at Leave alone if the requirement does not call for changing editability. Requiring a field and preventing its completion creates a design problem that should be resolved before the policy reaches users.
Inherit extends a policy to tables derived from the selected table. A policy on task can therefore affect incident, problem, and change tables when inheritance is selected. Review those child-table use cases before choosing it. Test a representative record from each intended child table rather than assuming the same field requirement fits all workflows.
Reverse if false reverses the policy action when the conditions become false. Include the transition out of the matching condition in your tests. The important question is whether the field should return to its previous intended state when a user changes the condition-driving value.
Scope also constrains the design. Cross-scope rules are restricted to fields in the policy’s scope, and a policy cannot make a field mandatory on a table in a different scope. Resolve that restriction before treating a missing mandatory effect as a problem with the condition. Multiple rules on a single field are possible but discouraged; review existing rules before adding another.
Check imports and web services separately
Entry-channel settings determine where parts of the enforcement apply. Apply to import sets includes records brought in through import sets, including web service import sets. Apply to SOAP covers SOAP web service data, with scripted SOAP web services excluded from that option. It does not control REST interaction.
By default, data policies apply to GlideRecord operations, including those in Scripted REST APIs and the REST Table API. Treat a REST test as a separate case from a SOAP test. Disabling a SOAP option is not a reason to expect REST writes to bypass the policy.
Use as UI Policy on client adds enforcement through the UI policy engine. Defining a data policy also enforces it when a record is submitted from the UI, and that submission behavior cannot be disabled. A change in client-side presentation therefore does not prove that a noncompliant save will succeed.
Build a small test matrix listing each actual writer, the condition-driving values, the required field, and the expected result. Include a valid payload and a payload missing the required value. Noncompliant data produces an error; capture the observed result so the integration owner knows what must change upstream.
Keep adjacent controls clear in the design review. Use data privacy jobs and policies for the separate anonymization workflow, and consider field encryption configuration when protecting sensitive field contents is also a requirement.
Decide whether conversion preserves the intended behavior
Converting a UI policy can extend an existing form requirement to data entry beyond the browser. The ui_policy_admin role is required for that conversion. Open System UI > UI Policies, select the policy, and use Convert this to Data Policy under Related Links.
Before conversion, Run scripts must be cleared, Global selected, and Visible set to Leave Alone on the UI policy actions. Actions that set Visible to True or False make the UI policy ineligible. Conversion deactivates the original UI policy. Select Use as UI Policy on client on the resulting data policy when the requirement should remain in the UI.
The reverse conversion requires admin. Open the data policy through System Policy > Rules > Data Policies and select Convert this to UI Policy under Related Links. This deactivates the data policy and creates a UI policy whose enforcement is at the UI layer. It provides the Visible setting, but removes the converted policy’s enforcement for import sets and SOAP imports.
Choose conversion after reviewing the entry-channel matrix, especially when a form requirement already supports integrations. Keeping a data policy with client enforcement may fit better than converting it. For help planning this work, see ServiceNow implementation.
Test condition changes and investigate failed writes
The Automated Test Framework data-policy example requires atf_test_admin. Its test sequence impersonates a user with appropriate permissions, opens a new incident form, checks the initial field state, sets the triggering condition, and validates the changed field state. Build assertions around the intended field state rather than checking that a form merely opens.
Add a separate save test and the integration cases from your matrix. Include a record outside the condition, a matching record with missing data, a matching record with complete data, and a transition back outside the condition. Record the user and entry channel for each result.
For investigation, navigate to System Diagnostics > Session Debug > Debug Data Policies. Review the debugging messages alongside the policy’s conditions and rules. Use record history as a related investigation topic when you also need to understand changes around the affected record.
Questions about rolling out field enforcement
Can a data policy make a field mandatory on a table in another scope?
No. A data policy on a table in a different scope can only target fields in its own scope, and it cannot make a field mandatory there. Use a rule in the table’s own scope for that requirement.
Do data policies block REST API writes?
By default, yes. Data policies apply to GlideRecord operations, including Scripted REST APIs and the REST Table API. The Apply to SOAP and Apply to import sets options control only SOAP and import data, so they do not turn off REST enforcement.