<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
Update a JSON Object Using the Object—Set Card in Workflows
Workflows
Okta Classic Engine
Okta Identity Engine

Overview

This article shows how to update a JSON object using the Object—Set card Okta Workflows.

Solution

The Object—Set card:

Sets a key of an object to a specified value, creating a new key if it does not exist already.

The following flow demonstrates how the card works.


Using the Object—Set card.

 

Flow steps

The flow has the following steps:

 

Create an object

The Object—Construct card creates a JSON object:

{
  "Last name": "Green",
  "First name": "Jane",
  "Email": "jane@okta.com"
}

It is also possible to work with a JSON object received from an API card or other previous cards.

 

Update an object

The Object—Set card looks for the Email key. When it finds the key, it updates the key value to jane.green@okta.com.

{
  "Last name": "Green",
  "First name": "Jane",
  "Email": "jane.green@okta.com"
}

 

Insert a key

The Object—Set looks for the Department key in the last step. Since the key is not present in the object, the card inserts a new key/value pair.

{
  "Last name": "Green",
  "First name": "Jane",
  "Email": "jane.green@okta.com",
  "Department": "Engineering"
}

Related References

 

 

Loading
Update a JSON Object Using the Object—Set Card in Workflows