Rest API error: The result was not an array


when running a test for the Rest API I addedd under Get collection (GET) I can see a result coming back but with an error.

This is what I get:

Error: Error:
The result was not an array. Maybe the data you’re looking for is inside one of the response object keys?

“n”: 62,
“jobs”: {
“53819”: {
“ID”: 53819,
“slug”: “job-test1”,
“title”: “Job Test 1”,
“content”: “This is where the job description is.”,
“url”: “”,
“employer”: {
“name”: “Employer Test”,
“address”: “Street 1, 1060 City”

I tried adding different values to the Response key path, but I always get the same error back.
Is there maybe something wrong with results?
Shouldn’t there be brackets [ and ] in the results?

Thanks for your help!

Looks like your API is not returning an array but instead a single object, unless there’s something bugging out. Is the raw API request something you can share so we could check it out?

Here is the URL of the API I am using (I created a URL):

deleted URL

Maybe that helps?


So the issue is that your response does not contain an array of data, but instead an object with ID keys pointing to the data. Unfortunately, this sort of data transformation is not possible directly from the REST data configurator.

Are you able to edit the current endpoint or create an additional endpoint that would return the jobs objects inside an array?

Alternatively, you could define the item schema manually into an app/page variable, use HTTP request to fetch the raw response, then use a formula to map the data into an array for Set page variable:

VALUES(outputs["HTTP request"]
1 Like

Great, thanks for the information!
I will try adding the item schema manually first, if that doesn’t work for some reason, I will ask a developer to edit the endpoint.

1 Like

Hi again,
I tried your alternative suggestion and add the item schema manually into an app variable.
Then I used the http request node to fetch raw response.
But the last step (“use a formula to map the data into an array for Set page variable”) is where I am stuck.

Do I need to change anything in this formula:
VALUES(outputs["HTTP request"]

Some values I want to use from my feed are "title, “url” and “posted_date”.
On the screenshot you can see the raw response I get from the JSON feed.

Thanks for your help!

How does the result of that formula look like if you use the debugger or paste it to an Alert node? It should be an array of objects like

    "ID": 14417,
    "title": "...",

though of course with more fields.

1 Like

It looks like this:

I put the feed URL in the http request node and the formula in the Dialog message.

Does my last response help? The id of my project is 98833.

I think I am pretty close to a solution here. :slight_smile:

@Harri_Sarsa Does the screenshot help in any way? I appreciate your help!

Jo_Li, maybe I could help, but the screen shot needs to have visible the first instance of the object in your initial question and some lines before it, in order to identify the structure of the API response.

@Eduardo_Jaramillo Thanks Eduardo!

This is the URL of the feed: where you can see the response.

Sorry Jo_Li, but the link redirects to the page, not to your feed. Can you check it out?

that’s strange. here is the actual URL:
(deleted URL)


Looking up your data, the most probable cause for the REST API direct integration not returning an array, but an object is in the GETALL return schema, which should reflect your data structure buy can have some variations depending on your database engine. Since the key for each set of data is a number, it will be rather long and prone to problems if there are new sets (the schema would change with every modification to the data and as the return data wouldn’t match the schema, it will be treated as an object, not an array). In the following image you can see the problem:

As you can see in the following example, the record number is not a key but a simple value and the data sets is inside the “fields” key (inmutable)

Hope this helps,

Thanks for checking and your help.
I will check with a developer to see what we can do to fix this.

Not sure where this all landed, but I had the same issue today while testing a connection. The problem ended up being the use of the ‘Resource URL’ in the ‘response key path’ input. I am NOT a coder, so I found this forum and realized my issue through the tutorials post by Steve Stava on YouTube. Just posting in the event this helps someone else down the road.

1 Like

Hello, I am running into the same issue the OP had. I am hoping you can elaborate a bit more on the solution you found. Did you need to add or remove something to the ‘response key path’? Thanks in advance:)

Hi, I’m having the same error with Firestore. Anyone have a solution?

Eu me deparei com o mesmo problema e consegui resolve-lo da seguinte forma.:

  1. Verifiquei que na planilha existiam linhas vazias entre registros, eliminei-as todas.
  2. O nome da planilha e da aba continham caracteres que não eram números ou letras, eliminei-os todos.
    Refiz todo o processo e obtive sucesso.
    Boa sorte …