Forum Discussion

mbostrom_dtiq's avatar
mbostrom_dtiq
New Contributor II
6 years ago

Making an array with JSON

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:

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:

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

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

1 Reply

  • tstack's avatar
    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