<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 Pass an Array Attribute in the Okta User Profile When Calling the "Identity-Sources Bulk-Upsert" Method
Okta Classic Engine
Okta Identity Engine
Lifecycle Management
Overview

This article explains how to pass an array attribute in the user profile when calling the identity-sources bulk-upsert method.

For example:

{
    "entityType": "USERS",
    "profiles": [
        {
            "externalId": "user1@example.com",
            "profile": {
                "userName": "user1@example.com",
                "firstName": "user1",
                "lastName": "user1",
                "email": "user1@example.com",
                "stringArray": ["test1","test2","test3"]
            }
        }
    ]
}

 

Passing "stringArray": ["test1","test2","test3"]  results in the following error:

 

400 Bad Request 

The request body was not well-formed

 

Applies To
  • Identity Source
  • Bulk-Upsert
  • Okta Classic Engine
  • Okta Identity Engine (OIE)
Solution

To resolve this, follow the steps below:

  1. Pass the variable as a comma-delimited string, then in the profile mappings convert it to an array.
    • The "USERS" array would look something like this in the API call:
      {
          "entityType": "USERS",
          "profiles": [
              {
                  "externalId": "user1@example.com",
                  "profile": {
                      "userName": "user1@example.com",
                      "firstName": "user1",
                      "lastName": "user1",
                      "email": "user1@example.com",
                      "stringArray": "test1,test2,test3"
                  }
              }
          ]
      }

 

  1. In the profile mappings for the Custom Identity Source profile, use the following expression to convert the string to an array when mapping it to the Okta user attribute:
    Arrays.flatten(appuser.stringArray)
Loading
How to Pass an Array Attribute in the Okta User Profile When Calling the "Identity-Sources Bulk-Upsert" Method