"Cannot access offset of type array on array" Error with Array Input

Answered

I'm trying to send a multi-select field from a WeWeb form to my Xano endpoint, which is a POST request. The payload from WeWeb is a clean JSON array of strings, for example: current_toolset: ["email_marketing", "llm", "crm"].

In my Xano database, the field current_toolset is correctly set up as a text[] (text array).

But in my API endpoint's function stack, I'm running into a data type mismatch. The "Add Record" function returns the error: Input requires text[]. Currently set to text.

I have already tried the following troubleshooting steps:

  • I confirmed the payload from WeWeb is a valid JSON array.

  • I added the json_decode filter to the {{ current_toolset }} variable inside the "Add Record" step. This did not resolve the issue.

The input variable in my endpoint is a List, but there is no option to define the Type of the items within that list. It defaults to "Any," which might be the cause of the problem? I see no way to change it to "Text".

I somehow had this working but when I had to remove an input from my endpoint, it deleted all of them and now I can't figure out how I had it working earlier.

Thanks


11 replies