Hi all
In the create person form I added a multiple selection field that gets the information from the "Areas de trabajo" data list.
In order to do this, I added a column to the bx_persons_data table, I created the field "Areas_de_trabajo" type bigint (20). I honestly don't know why I created the field with that type.
The issue is, the selection that a person makes is saved iin DB as a number, for example 33554432 or 195, etc. My question is how does the software (UNA) to translate that number to one or more specific workspaces from the list of "Areas de trabajo" created ?
I hope someone can guide me.
Thank you.
- 1188
Comments
Hello Claudio Acosta !
Just specify plz the one thing - why did you add the field to the `bx_persons_data` table via phpMyAdmin (looks so) ? Or you did it via Studio Forms App?
Hi LeonidSWhile that field and others I added in the form via Studio-Forms, I remember adding it earlier via phpmyadmin.Wasn't it necessary to do that? When adding a field in a form, via Studio-Forms, that field is automatically created in the table in the database?Thanks.
Yes, this is the only proper way - create the fields only via Studio->Forms app or via the Developer App, Forms section.
Thanks LeonidS, I understand now.Anyway the query is the same. That is, the UNA platform works correctly, I can correctly view the information selected by the person in the form. No problem with this.My question is how I have to do (running my own software) to translate that value saved in the bigint field to the values selected by a person, that is, how does UNA do it?Thanks.
J
The values are stored in the database field as a binary number. In inc/classes/BxDolForm.php, you will find the passSet function that takes the array of values and creates the number that is stored. There is also the displaySet function that takes the stored database value and translates it into the original array of values.
Thank you Jerome Mingo It's what I needed to know.