cancel
Showing results for 
Search instead for 
Did you mean: 

Making an array with JSON

mbostrom_dtiq
New Contributor II

Hi all,
I’m building an integration do DocuSign but when I use the JSON Generator it works fine and looks like this:

Notice how the templateRoles has an “[” within the JSON specifying some array with the JSON:
image

When I use a mapper to try and create this JSON in that format it outputs it without the brackets and causes an API issue as it expects an array within that templateRoles section.

Here is my mapper:
image

Now check out the output of the mapper how it does NOT have the brackets embedded within that in the templateRoles node:

image

What do I need to do to get the output in the same format as the JSON generator?

1 REPLY 1

tstack
Former Employee

The Target Paths for the templateRoles property do not include the array index (e.g. [0]), so the Mapper is going to create a sub-object instead of an array with an object in it. In other words, instead of:

$templateRoles.name

You want:

$templateRoles[0].name