Can't insert or upgrade database with a Tagify data, in a Custom Query

Wappler Version : 5.1.5 (Pro)
Operating System : Windows 10 64 bits / Linux
Server Model: Apache / PHP 8.0.x / gnix / windows
Database Type: MySql 8 - InnoDB
Hosting Type: Developement

Hello,

This is happening in the Server Side Components.

I use a lot of custom tables (dynamic names) and I can’t update a field in Tagify format with a “Database Custom Query” component.

Everything works fine with “Database Update Component”

Normal update screenshot

Custom update

I did everything as in the examples and tutorials.

I’m not sure if it’s a bug.
But how can a simple copy of a mysql code not work?

Thanks for the feedback.

I attach an example file.
Produits.zip (2.1 MB)

Hello,

With a lot of perseverance, I found a temporary solution to my problem following a direct insertion (in the Custom Query component) attempt giving a “Cannot read properties of undefined (reading 'forEach)” error…

Add square brackets in the MySql query as follows:

'[{{variable}}]'

The problem is not solved. But this allows me to continue my project while waiting for your feedback.

Not sure what you are posting for category, is it an array?

You can try {{$_POST.category.toJSON()}} as expression. The problem with the custom query is that we don’t know what value is expected in the column, with the normal update we have the schema information from the database which we use to determine if we need to convert the value first. Like with the category which is a json field, the driver doesn’t support arrays as value and we need to do the json serialize before passing the value.

The custom query probably will need to be updated to allow you setting the type of the parameter so that we can convert them correctly for the database.

Hi Patrick !

It’s working great with Wappler 5.2.

Tagify module pass the JSON data like : [“1”,“2”,“3”,“4”,“xx”, “ABCD”]

Thank you! :ok_hand:

I had made an attempt with this function, but misused it.

I don’t see this function in the formater dialog box:

I would have liked to know if there is a list of unreferenced functions, like this topic:

Thanks again