# Workflow code for Identity Filtering

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-code-for-identity-filtering/14096>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [July 10, 2023, 4:22pm UTC](https://developer.sailpoint.com/discuss/t/workflow-code-for-identity-filtering/14096 "2023-07-10T16:22:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hearst2k](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@hearst2k](https://developer.sailpoint.com/discuss/u/hearst2k)\
**Post date:** [July 10, 2023, 4:22pm UTC](https://developer.sailpoint.com/discuss/t/workflow-code-for-identity-filtering/14096/1 "2023-07-10T16:22:07Z")

</div>

I see the closest possible filtering to be: Trigger=Identity Attribute Changed. Is there a way to specify an OldValue and/or NewValue?

Also, similar to Roles or SearchQuery, do we have a way to trigger workflow only on certain attribute conditions? Like

```auto
if(cloudLifecycleState!=active) ExitWorkflow
if(attributes.costCenter==C1 AND attributes.department!=D1) ExitWorkflow
if(attributes.costCenter==C2 AND attributes.department!=D2) ExitWorkflow
if(attributes.costCenter==C3 AND attributes.department!=D3) ExitWorkflow

```

Basically, we have a Search Query filter to find an Entitlement. Similarly, I am looking for a Search Query filter for the Identity to add restrictions to the Workflow getting triggered, similar to Rule/Population in IIQ Triggers.

---

<div class="post-metadata">

**Author:** ![sharvari](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sharvari](https://developer.sailpoint.com/discuss/u/sharvari)\
**Post date:** [July 10, 2023, 5:05pm UTC](https://developer.sailpoint.com/discuss/t/workflow-code-for-identity-filtering/14096/2 "2023-07-10T17:05:19Z")

</div>

You can refer to this event filtering article here which can help you build filter for your specific Workflow trigger.

> **[Filtering Events | SailPoint Developer Community](https://developer.sailpoint.com/idn/docs/event-triggers/filtering-events/)**
>
> Many triggers can produce a staggering amount of events if left unfiltered. Event filtering helps you solve this problem.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [September 8, 2023, 5:05pm UTC](https://developer.sailpoint.com/discuss/t/workflow-code-for-identity-filtering/14096/3 "2023-09-08T17:05:48Z")

</div>

Closed on September 8, 2023, 5:05pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
