ERROR: Array of objects expected in parameter 'fields'

I am trying to fill a pdf form using the pdf.co fill a pdf form module.

I would like to pass an array to the ‘fields’ field but am receiving the following error “Array of objects expected in parameter ‘fields’.”

See the screenshots below.


Screenshot 2024-02-06 at 8.18.56 PM

These are the parameters the module allows.
Screenshot 2024-02-06 at 8.34.41 PM

Welcome to the Make community!

Your structure appears to be correct.

However!

That is just a JSON string representation of an array, but it is not a variable of type array.

You need to convert the JSON string into an array using the Parse JSON module.

Here is an example of how to map it:

Screenshot_2024-02-03_000227

You might need to “wrap” your array with a variable:

{
  "array": INSERT_ARRAY_JSON
}

If you do not want to mess with JSON strings, you can use an Array Aggregator module instead.

3 Likes

That worked, thank you! I had tried that module previously but omitted wrapping the array with

{
   "array":
}

Thanks again.

No problem, glad I could help! Have a nice day.

2 Likes