How to filter out duplicate elements

I want to create the governance group by workflow.When I aggregate the Active Directory source,it will trigger the workflow.The workflow follow these steps.
1.aggregate all accounts in Active Directory source.
2.get these accounts dept attributes and store in list
3.filter the duplicate elements
4.create the governance group according to dept
How do I complete step 3?

To complete step 3 (filtering duplicate department values), you can use a script action within the workflow to process the list. In the script, convert the list of department values into a Set, which automatically removes duplicates. For example, in JavaScript: let uniqueDepts = […new Set(deptList)];. This gives you a clean list of unique departments to use in the next step. You can then loop through uniqueDepts to create governance groups accordingly.

where do I found script action ?

In SailPoint Identity Security Cloud (ISC) workflows, the Script Action is not directly labeled as such — instead, you use a “Transform” step with a JavaScript script to achieve custom logic like filtering duplicates. Here’s how to do it:

To find and use a Script (via Transform) action in a workflow:

  1. Go to your Workflow in the ISC UI (Workflows → Your Workflow).
  2. Click the “+” to add a new step after your department list has been built.
  3. Choose the “Transform” step (this acts like a script block).
  4. In the transform, click “Create New Transform”.
  5. Select “Script” as the transform type.
  6. Enter a name (e.g., DeduplicateDepartments).
  7. Use the following sample JavaScript code:
let deptList = input.deptList || [];
let uniqueDepts = [...new Set(deptList)];
return uniqueDepts;
  1. Save and return to your workflow. The output of this transform (uniqueDepts) is your deduplicated list.

Example usage:

  • Input: deptList (from your earlier workflow steps)
  • Output: uniqueDepts (used in a loop to create governance groups)

let me know if it works

If you have created 1st two steps in workflow then share the payload of it, let me try to find the approach

Sorry,I cann’t find “+” to add a new step .The video is my workflow UI.

I just get the account data currently.the payload is here
payloadHere.json (64.2 KB)

  1. I don’t have uniqueValues right now.How do I get ?
  2. I cann’t find “Operation” to Append to Array,where do you found?
  3. If I create the variable name “accountDeptList” out of the loop,how do I add the value to the “accountDeptList”?

@TOPTYU

Regarding the use case:

If you’re using the aggregate accounts trigger, the workflow will attempt to create a GG every time an aggregation completes, which could result in multiple duplicate GGs being created.

Could you please elaborate on your exact requirement? I may be able to suggest an alternative approach.


After creating uniqueValue , I will check which governance groups exist in ISC, and only create the governance group if it does not already exist in ISC.How do I create uniqueValue after collecting account info?

Hi @ManvithaNalabolu06,
Can you please share if you have done this before and written a code in your workflow ? I am not able to find where can I write the code?

Thanks