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

In this guide:

  1. Okta Workflows guides
  2. Using the Object—Set card
  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 do you update a JSON object using the Object—Set card Okta Workflows?

This guide will teach you how to update a JSON object using the Object—Set card Okta Workflows.

Using the Object—Set card

The Object—Set card:

Sets a key of an object to a specified value, creating a new key if it doesn’t 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"
}

You can also work with a JSON object you 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"
}

Okta Workflows resources

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

📺 Learn from Workflows videos.

🛟 Ask questions and share your flows on the Okta Workflows community forum.

🙋🏻‍♀️ Get help from the community: join the #okta-workflows channel on MacAdmins Slack.

Leave a comment