API Schema repeat issue with numbers as field names

Wappler Version : 6.0.2
Operating System : Windows 10
Server Model: NodeJS
Database Type: PostgreSQL
Hosting Type: Wappler Local Server

Expected behavior

What do you think should happen?

When doing a database insert/update selecting the API schema output should work if the name of the field starts with a number

Actual behavior

What actually happens?

Any defined schema value that starts with a number is not accepted in the server data bindings window and just uses the field as the value

How to reproduce

  • Detail a step by step guide to reproduce the issue
  • A screenshot or short video indicating the problem
  • A copy of your code would help. Include: JS, HTML.
  • Test your steps on a clean page to see if you still have an issue

Define API that starts with a number (this is received back from an API output)

image

Inside of a Server Action Repeat, run a Database Update. When matching the data to update, in the server binding window selecting in this example 4175 outputs _[‘repeat[0]’][4175]
image
image
To see if there are any issues on any of the other fields, it does not happen if I select “id”
image
image

As a test, I can go to the API Schema and rename “4175” with a letter, so “A4175” and it does not have an issue with that
image
image

If it starts with a number and ends with a letter I get something like " {{_[‘4175TEST’]}} " as the result

Unfortunately I do not have control over the API source and this is the field value they are giving me so I have to use it.

If I do leave it as is, it just returns 4175 as the value for the database insert or update

image

Thanks for any assistance.

To follow up on this issue. As a workaround I am just running a column rename after the API action then running the repeat on the column rename action instead. Still seems like a bug to me that it does not accept a number as the field name.

image

You really should never use just numbers as column fields. Those will give you always trouble. Try starting with at least a letter.

1 Like

This is coming from an HR system’s API. We don’t have an option to not use numbers for some of the field names.

will make sure the numeric field names are also well escaped in the next update.

This is now fixed in Wappler 6.0.3

Tested this in 6.0.3. It does work in showing the correct value in a database update which is great and thanks for the quick fix, however the value cannot be formatted get the following error when trying.
image
image

After clicking OK, just get an empty data format window.

This topic was automatically closed after 26 hours. New replies are no longer allowed.