Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By Michael44
#829314
Hello all,

I created a string variable behind a textare in a dynaform. There's no option to change the length. In the database it is a string(10). When an user enters a long text I get an error "... Could not execute update [Native Error: Data too long for column ..." When I open the case the error is also coming up.

How do I change the length of a variable? Do I need to do it directly in the database? I miss an option in the definition of variables...

Thanks for your help.
User avatar
By kirkwg
#829315
Hello,

I am not sure what is your questions exactly, and I try to answer them for what I guess, thanks.

1/For Textareas control in Dynaform, as doc said there is no length property, say could have row#, etc.
==> meant we can't set its length in dynaform. (While Textbox control could have a length property)

2/Supposed we won't see the Textareas field in the DB?
==> then I will think if you are creating a Report Table or not??
==> If creating a Report Table, the default for Textareas or Textbox variable/id is VARCHAR(255), which accepts 255 characters for maximum, etc.
==> So I don't know why you could see String(10)

Kindly try attach any screenshots so that I may be clear of what are your issues about, thank you!
User avatar
By programerboy
#829316
Hi,
You have created a report table in your process and in that report table you have also used the field on which you get the error.
So you have to go to the report tables section and edit your report table and then double click on the desired field and change its field type to longvarchar and set its allowable length to 999.
Keep in mind when creating the report table, unfortunately we do not have the type of text field!

https://pmlearning.info
Thanks
By Michael44
#829321
Hello and thanks for your reply.

I'll try to concretize what I'm doing.

1) create string var
Go to the process -> click Variables at Process Objects -> create var "text_test" as string

2) Add var in dynaform
Go to Dynaform at Process Objects -> add textarea -> select var "text_test"

3) create a case
Create a new case -> add text in that textarea field with 1000 charachters -> save -> error message: "... Could not execute update [Native Error: Data too long for column ..."

4) check mysql database
-> so I need to change the length of that var
-> go to table PROCESS_VARIABLES via sql, search the desired row of that var -> VAR_FIELD_TYPE = "string", VAR_FIELD_SIZE = "10"
-> that's not enough
-> question: where do I change this in processmaker to allow e.g. text input of 1000 charachters?
-> change value VAR_FIELD_SIZE to "10000"

5) create a case
Create a new case -> add text in that textarea field with 1000 charachters -> save -> all good


So my main question is: where do I change the length of a variable created in PM? Is my manual edit of VAR_FIELD_SIZE in the database OK and correct?
User avatar
By programerboy
#829322
Hi,
See, dear friend, when you create a variable and use it in your form, you will not receive the same error until you have created the report table from that field. Because all of your form data is stored as a serialized string in the database, it is not a separate column for each field.
But when you create a report table and consider its length to be short, but the data you enter in the form is longer than that, you get an error.
Then change the length of the field created in your report table.
If you think the error is different, please send the full text of the error to indicate on which column you are getting the error from which table.

https://pmlearning.info
Thanks

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]