Unusual error when adding new record using simple API call

Options

Hi all,

I believe this is a bug. Very unusual behaviour attempting to add a new record to this table. All fields are spelt correctly. Unsure to why its returning this error. Any feedback would be welcome.

code: ERROR_CODE_INPUT_ERROR,
message: Invalid method for filter - trim,
param: user_id
[err.png][err2.png]
Thanks,
Michael

Comments

  • Mr_English
    Options
      Hi you've probably checked this but - given that you have string error message and you are passing in an int, in the function stack - Inputs, is the user_id set to int? E.g.
    [image.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    @ are you using a DB link and was this field perhaps text at one time? Remove the database link and re-add it and it should be OK
  • Michael Cafra
    Options
    I removed the database link and reapplied it and received the same error. I deleted the whole table and recreated it and it has solved the issue. Still unsure to what was originally causing it. 

    Thanks for your assistance.
  • Steven J
    Steven J Member
    Options
    I see this same issue. When I do reapply the database link it brings it back, but anytime I save the endpoint, it erases it
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     it would've been when you changed the schema type of one of your fields. Probably was originally text and then was changed to some other type
  • Daniel
    Daniel Member
    Options

    I've been stuck for a week on this and couldn't figure it out! After tons of research, thinking the problem was a million other things, I found this thread by Googling specific parts of the error. I ended up having to create a new column and name it something else because unlinking and then relinking does not work. Hopefully, the Xano team can fix this.

  • Alimama
    Alimama Member
    edited January 2023
    Options

    I believe this happens when you change a text field to other types. The problem is even after changing the field to other types, the default filter for text fields, trim, still remains stuck in there as the filter for the field, despite changing it to e.g. integer. As you attempt to add other non-text data into the field, the non-text data is passed to the trim filter as a value, this throws the error since trim does not accept non-text values.

    Workaround: Delete the field and create a new one. Best to create it with the same name so the integrity is maintained in case other tables or APIs are referencing it.

    SOLUTION: The XANO team can work out a solution that ensures the trim filter is removed whenever a text field is changed to other non-text types.

    Hi @Michael Udinski, I think this can be resolved in one of the future rounds of bug fixes. Thanks for the awesome job you guys do.