Module not recognizing array

So I have a set variable module, going into a pdfco API call. There is clearly an array, however upon running, I’m getting this error: “The operation failed with an error. [400] Invalid parameter ‘searchStrings’ value “the, !, _, -, $, then”: Must be an array of any type.”


1 Like

@jff
Hi, I have a few questions.

  1. What API endpoints are you calling in the PDF.com module?
  2. Please paste the contents of 23. emailBody[] from your execution history.

Hey,

  1. API endpoint: /v1/pdf/edit/delete-text
  2. From output bundle: “emailBody”: [ “the”, “!”, “_”, “-”, “$”, “then” ]

Thank you.

1 Like

@jff
I found the following page in the help section of PDF.co, but the name of the Parameter may be searchString (not searchStrings).

The sample in the API Reference is also “searchString”.

I doubt that you can specify an array as a parameter, so I suggest you contact PDF.co support.

So on the API page for Search and Delete Text it does list searchStrings as an option, with the description given as “The array of strings to search.”

1 Like

Is it possible that there is an error in the documentation?

So I went to PDF.co’s support, and apparently this should work but it’s a known issue that it doesn’t for some reason in Make.

I was told I should try to use a Create JSON Module then the Parse JSON Module, however I can’t figure out how to do this when the number of items going into the array is unknown.

2 Likes

I see, so it’s a known bug, and it might be a good idea to report it as a bug to make.com as well.

Do you mean using the Create JSON and Parse JSON modules for the values to be entered into serachStrings?

So this is exactly what they said regarding the JSON Modules:

  1. Create JSON Structure: Use the “Create JSON” module to ensure the list of text to delete is formatted as an array of strings (["string1", "string2", "string3"]).

  2. Parse JSON: Use the “Parse JSON” module to convert the JSON string into an array before passing it to the API.

1 Like

@jff
Thank you very much.
From your reply, I think you mean to use the Parse a JSON module after entering the Create a JSON module as attached.

Yes, except the text there are just for example. In practice it would be an array of strings, the number and contents of which would not be known in advance.

How is the string to be deleted retrieved?

The text is retrieved from the body of a received email and then parsed to separate the text into words, numbers, and special characters, which are then put into an array.


Since the Split function returns an array, wouldn’t it work if we pass the output from the Set Variable module to the Create JSON module?