<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 Replace a JSON Key Pair Value Using Workflow
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

In some cases, it may be necessary to replace a JSON key-value pair with a different value. This article provides an example of how to do so.

Applies To
  • Okta Workflows
Solution

In this example, the null-valued key "externalId" has been replaced with a different key/value pair: "Teams": "Core Team."

Here is a JSON object example:

[
{
"id": "00uer81nx6g6wuuar1d7",
"role": "employer",
"firstName": "Isaac",
"lastName": "Brock",
"externalId": null
},
{
"id": "00uer82nqzjZ6ipX61d7",
"role": "employer",
"firstName": "Isaac",
"lastName": "Brock2",
"externalId": 10281
}
]


Use the Replace Pattern card and set the pattern to \"externalId\":[\s|\w]*.

Replace Pattern card  

Here is the output in the JSON Parse card:

output in the JSON Parse card   

 
Loading
How to Replace a JSON Key Pair Value Using Workflow