<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Remove Duplicates from a Table in Okta Workflows
Workflows
Okta Classic Engine
Okta Identity Engine

Overview

This article will show how to remove duplicates from a table using Okta Workflows.

 

Solution

The following table exists, and duplicate department name entries need to be removed:

Example table with duplicate entries Workflows table.

 

 

The table looks like this after removing duplicate entries:
Example table with duplicate entries removed

Workflows table.

 

 

The solution has two flows:

  • Remove Duplicates flow
  • Create Row flow (helper)

 

 

Remove Duplicates Flow

The Remove Duplicates flow saves all table records into a list and removes duplicates from that list.

Example of remove duplicates flow

Remove Duplicates flow.

 

The flow has the following steps:


Table – Search Rows

In this step, the Search Rows card returns all the rows from a table in a JSON format that looks like this:

[
  {
    "Department Name": "Marketing"
  },
  {
    "Department Name": "Sales"
  },
  {
    "Department Name": "Engineering"
  },
  {
    "Department Name": "HR"
  },
  {
    "Department Name": "Marketing"
  },
  {
    "Department Name": "Engineering"
  },
  {
    "Department Name": "Engineering"
  },
  {
    "Department Name": "Design"
  },
  {
    "Department Name": "QA"
  }
]


List – Pluck

In this step, the Pluck card produces a list only with the Department Name key. The list looks like this


[
  "Marketing",
  "Sales",
  "Engineering",
  "HR",
  "Marketing",
  "Engineering",
  "Engineering",
  "Design",
  "QA"
]

 

List – Remove Duplicates

In this step, the card removes duplicates from a list. The result is a list without duplicates


[
  "Marketing",
  "Sales",
  "Engineering",
  "HR",
  "Design",
  "QA"
]

 

Tables – Clear Table

In this step, the flow clears the table before saving the list without duplicates into a table.

 

List – For Each

This step calls for a helper flow to save the list without duplicates in a table.

 

Create Row Flow


The Create Row flow creates a new row in a table for each item in the list.

Example of helper flow

Create Row flow.

 

Table Without Duplicates

The result is a table without duplicate values:

Example of resulting table without duplicates

Workflows table without duplicates.

 

Related References

 

 

Loading
Remove Duplicates from a Table in Okta Workflows