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.
- Okta Workflows
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]*.
Here is the output in the JSON Parse card:
