<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
How to Conditionally Update a Table in Workflows
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

This guide will teach how to update a table based on a condition. If the condition is true, the record will be updated. If it is false, a new record will be added.

Applies To
  • Okta Workflows
Solution

The table has two columns: Product and Access counter.
Workflows table 

 

The flow below will search the table for a product. If a product is found, the Access counter is updated. If a product is not found, a new record is added to the table.
Update or create a record in a table flow 


The above flow has the following steps:

  1. The Helper Flow card provides input to the flow. It is possible to enter a product in the table or a new product.
  2. The Tables – Search Rows card searches the table for the entered product. It returns the Row ID field.
  3. The Branching – If/Else card determines if the product is in the table or a new product.
    • If the Row ID is not empty, a product is found (yellow section).
      • Using the Tables – Update Row card, update the record by increasing the Access counter column by 1.
      • The Compose card creates a message for the If/Else card output (for update condition)
    • If the Row ID is empty, it is a new product.
      • Using the Tables – Create Row card, add a new product record to the table.
      • The Compose card creates a message for the If/Else card output (for new record condition).

The Branching – If/Else card condition editing:
 Editing Branching – If/Else card condition 


Clicking on the arrow pointing icon will open the following view to edit the condition:
Condition editing 


Running the flow with input Bread results in a record update:
Testing the flow 


After the run, the Access counter for Bread is updated:

Table after update


Running the flow with input Cheese results in a new record:
Testing the flow 

 

After the run, the table has a new product record:
Table after adding new product 

 

Related References

Loading
How to Conditionally Update a Table in Workflows