How to apply conditional data anonymization in ServiceNow

kunica katke
Tera Contributor

We have a requirement to apply anonymization in ServiceNow, but only under specific conditions. For example, anonymize sensitive fields (like caller name, email, etc.) only when an Incident record is in a Closed state.

Has anyone implemented conditional anonymization using Data Anonymization policies or Flow Designer?

  • Is it possible to configure anonymization rules to run based on a condition (such as state = Closed)?
  • What’s the best approach: using out-of-the-box anonymization features, business rules, or a custom flow?

Any guidance, best practices, or sample configurations would be greatly appreciated!

Thanks,
Kunica

1 REPLY 1

Matthew_13
Mega Sage

Yes, this is doable, but it’s not something the out-of-the-box anonymization policies handle by themselves.

ServiceNow’s Data Anonymization policies don’t really have a built-in “only run when state = Closed” switch. They’re meant to run on demand or on a schedule, not react to a record changing state. So if you rely on policies alone, you don’t get true conditional behavior.

The cleanest and most practical approach is to control anonymization with Flow Designer. You create a flow that runs when an Incident is updated, add a condition like State changes to Closed, and then anonymize the required fields in the flow. That way, nothing is anonymized until the record actually meets your condition.

You could do this with a Business Rule as well, but that tends to get messy and harder to audit over time. Flows are easier to understand, log, and maintain, especially for something as sensitive as anonymization.

So in short:

  • OOTB anonymization alone isn’t enough for conditional logic

  • Flow Designer is the best and most supportable option

  • Business Rules work, but are generally a last resort

This is a fairly common pattern, and Flow-based anonymization on state change is what most teams end up using in practice.

 

@kunica katke - Please mark as Accepted Solution and Thumbs Up if you find helpful 🙂