Data policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:26 PM - edited 06-24-2024 11:45 PM
Hello family,
We have a Data policy written on sysapproval_approver table
This data policy is for when the approval rejected it will make comments mandatory
I wanted to exclude this data policy to not to apply for any Requested items(RITMs) that are been created. How can I exclude only Requested items (RITMs) exception for this data policy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:47 PM
Hello @Yashsvi ,
I need the data policy to not to work for RITMs only .. how can we only relax this policy for RITMs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 12:10 AM
Hi @mounika7675,
To exclude Requested Items (RITMs) from a data policy in ServiceNow, you can modify the conditions of the data policy to ensure it does not apply to records of the type "Requested Item" (sc_req_item). Here are the steps to do this:
your current condition looks something like this:
State is Rejected
Modify it to:
State is Rejected AND Table is not Requested Item [sc_req_item]
By adding this condition, the data policy will not apply to the "Requested Item" table records when their state is "Rejected".
Advanced: Scripted Conditions:
Write the Script:
- Write a script to exclude RITMs
// Check if the table is 'sc_req_item'
if (current.getTableName() == 'sc_req_item') {
answer = false; // Exclude RITMs
} else {
// Original conditions
answer = current.state == 'rejected';
}
Save the Data Policy:
- Click "Update" or "Save" to apply the script.
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:58 PM
Hi @mounika7675,
Instead of data policy, can you use existing UI Policy and if it does not exist on your instance then please create this UI Policy below as peer the screenshot:
Please accept my solution if it works for you and thumps up.
Thanks
Jitendra
