Remove Duplicates from a Table in Okta Workflows

In this guide:

  1. Okta Workflows guides
  2. Remove duplicates from a table
  3. Related Okta Workflows guides
  4. Okta Workflows resources

Okta Workflows guides

Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.

How to remove duplicates from a table in Okta Workflows?

This guide will teach you to remove duplicates from a table in Okta Workflows.

Remove duplicates from a table

You have the following table and need to remove duplicate department name entries from it:

Workflows table.

The table looks like this after removing duplicate entries:

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.

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 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.

Create Row flow.

Table without duplicates

The result is a table without duplicate values:

Workflows table without duplicates.

Okta Workflows resources

🍫 Get help from Workflows specialists during weekly community office hours.

πŸ“Ί Learn from Workflows videos.

πŸ›Ÿ Get help from support: discuss a Workflows topic or ask a question.

πŸ™‹πŸ»β€β™€οΈ Get help from the community: join the #okta-workflows channel on MacAdmins Slack.

Leave a comment