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

