<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 Create JSON Data in Workflows
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

This guide provides instructions on creating JSON data in Workflows.

Applies To
  • Okta Workflows
Solution

This article covers three ways to create JSON data:

  • Create JSON from a string.
  • Create JSON with the Object – Construct card.
  • Create a nested JSON object.

 

Create JSON from a string

If the following JSON string is given:

{
 "name": "Jane",
 "description": "Standard user",
 "email": "jane@atko.com",
    "features": {
       "SSO": "on",
       "MFA": "on",
       "Workflows": "on"
   }
}

The following will create a typed JSON data structure:
Flow that creates a typed JSON data structure  

The result of running this flow is:
Result  

The JSON – Parse card returns a JSON object with other cards:
JSON objec  

It is also possible to pass data from other cards to create the JSON data:
 

 

Create JSON with the Object – Construct card

The Object – Construct card can also be used to create a JSON object.

Object – Construct card  

 

Testing this card results in the following JSON object:
JSON object  

Using the Object–Construct card is handy when it is needed to create headers for an API service:
Object–Construct card  
 

The card creates the following JSON object:

{
  "X-Favorite-Food": "Pizza",
  "X-Favorite-Drink": "Tea"
}

 

 

Create a nested JSON object

A nested JSON object can also be created with the Object-Construct card. Notice that the field name is set to user.email, and uses a dot notation:

A nested JSON object


Testing the card:

Test the card


JSON result:

{
  "user": {
    "email": "user@okta.com"
  }
}

Related References

Loading
How to Create JSON Data in Workflows