REST API w/ MultiValue Attribute in JSON Response

Within NERM’s Workflow REST API configuration is it possible to parse a JSON response attribute into the component pieces (i.e. using [0], [1], or something similar)?

Example JSON being returned that needs to be split into 5 separate attributes in the profile

{
     "List 1": ["A", "B", "C", "D", "E"]
}

Where ProfileAttribute1 will be “A”, ProfileAttribute2 will be “B”, etc.

While I don’t have an answer for this currently, I do have a couple questions that would help someone else answer this if it is possible.

  • Will the “List 1” always have the same number of elements? (5 in this case)
    • If Yes, will those elements always go into the same attributes? (first always into PA1, two into PA2, etc)
    • If No, Will the values in the list going into the ProfileAttributes in order, until there are no more values? (ie, if [“A”, “B”, “E”], with those go into PA1, PA2, and PA3)

List item

In this particular case …
It’s a fixed number of items that will be mapped directly to related attributes in NERM (i.e. item 1 maps to ne_attributeItem1, item 2 maps to ne_attributeItem2, etc.)

But really a more fundamental/foundational question about the REST API block of functionality in NERM about handling of these types of objects. This is normally a “standard feature” of API consumption methods, but not sure if it’s possible in NERM and if so, what the syntax is.

Hey there! I think one of my team-members might have responded to you on a case for this same question, but I wanted to reply here as well since I just found this!

A JSON string array literal, like [“A”, “B”, “C”, “D”, “E”] is easily digested using the Data Mapping(s) function in the NERM REST API Actions. Below is a screenshot of how I set up the REST API action in a test scenario (Using a Postman Mock API Server to return the array literal data). If the order is always know, we can use the Data Mapping with the Path syntax of parent_key > List 1 > element_number

Displaying those values on a Page / Request Form, we can see that the mapping worked!

The exact Data Mapping Path will depend on the Response data, so I recommend using an API utility (Postman, cURL, Testfully, etc) to pull the back an example Response and use that to find the correct Path to the values for the Data Mapping.

2 Likes