Call REST (POST) Output Variable is a List type. How do I make it an Object type?

0
I'm trying to retrieve a REST object into entity, but the output is a List. How do I make the change the output of the REST Call to be an Object instead of a List?
asked
3 answers
3

Hi Evin,

This depends on the structure of the Schema source you choose when configuring the import mapping. If the object you map against is defined as a list in your Schema source then it will be mapped as a list.

So for example, if you have a JSON structure defined as:

[{
"test" : ""
}]

This will be seen as an array in your import mapping and therefor be translated to a list if you select the object inside of the array:

 

So I would check the datasource you used for the mapping first and check if you didn't define the top level as a list/array.

Regards,

answered
1

Evin,

is the output always one object in a list? If so, you can use the list operation "head" to get the top most object out of the list (in this case the only object). If you go down this route, I recommend using the list operation count and a exclusive split to check if count is equal to 1, before just taking the top object off the list. 

answered
0

Here's how I solved it: Under the "Call REST" activity, I went to the Response tab and selected the First object in the "Range". Thank you both for the help.

answered