Forum was very helpful yesterday. Giving it another go :)
CONTEXT: I'm creating a new Post. One post is related to many technologies via an Integer Array field (i.e. list of integers) that links POSTS and TECHNOLOGIES tables.
ISSUE: Xano correctly links TECHNOLOGY when the array has just one integer (ID), but does not accept & link up an array of integers. The error I get is “ERROR_CODE_INPUT_ERROR”
VISUAL BREAKDOWN:
It all works as intended in the debugger, creating a post with 2 technology ids:
It does not work in Production:
I have a custom frontend (React Native) using Axios for network requests…
→ formData.append('technologies_id', technologies.toString());
Where “technologies” is an array of integers.
I also tried this version:
→ formData.append('technologies_id', JSON.stringify(technologies));
For both: Status 400
LOGS:
But it works with just one number inside the technologies array: I changed the frontend code to make 'technologies_id' just one integer and it works.
—> formData.append('technologies_id', technologies[0].toString());
And also created a post where “technologies” was an array with a single Technology ID inside, and it worked:
So it seems like an odd type error - Xano accepts 'technologies_id' as a single integer & as an array with one integer element inside, but not when it's an array of integers, even though that's how its setup in the backend.
ALSO TRIED: I also tried changing the name of the input variable to “technologies” instead of “technologies_id' to see if it was an issue of crossed wires with naming, but that didn't make a difference.
SUMMARY: can't save array of integers in Xano, because it's expecting a single integer, despite the field type explicitly being a List (array) of integers. Wondering if there's some manual deserializing I'm supposed to do…
I watched this vid but didn't find it directly relevant / helpful (https://youtu.be/lYNwajsknKY)
thank you very, very much in advance!