I created a value list based on a table where I select three fields to show in the value list and only one to return on data provider, but I received the three fields into the field that is using the value list ???
Just to make sure: there is a checkbox “Return in dataprovider”. If all three of your columns are marked, all three will be returned. Maybe you post a screenshot if that’s not it.
What puzzles me a bit is this: you say you receive all three fields in the field where the value list is attached to. If I look at your screenshot, I see cntdki_id and presumably two text fields. I suppose this “cntdki_id” is some sort of an integer? If yes, how you can have the two text fields returned to your integer field without getting an error?
One thing that many do wrong at first with those value lists: if you choose to return an ID and show text, the field that is using that value list has to be set to non editable.
Other screen shots. You have the field definition and the view of the screen.
I have also other example where I want view 2 text fields : country code, country name and receive only country code but I receive the 2 fields back also.
That field “dmdd_fi_contacoffer”, that you attached the value list to, is an integer?
Anyway, to me that looks just fine. You created a value lists, that shows the ID, the first and the last name for the given ID.
So in your case, the value list shows “67Pierre-JeanHe…”, which is what you defined
column 1: ID
column 2: first name
column 3: last name
BTW: it looks nicer, if you add a space as a seperator in the value list definition. Then you get “67 Pierre-Jean He…”.
But that doesn’t mean, that this is actually stored in the field! Place the field once more on you form and do not attach a value list. Then you see what is really stored (should be 67, without any text). The whole story is just: what do I show my user and what do I need to store in the field.
The field “dmdd_fi_contacoffer”, is well an integer and when I add again the same field again on the form I receive only 67 on it.
In fact I need to show 3 fields to the user in order to allow him to choose the requester (contact) and display below in a portal all the related information.
So it seems that the problem is on my computer ?
Could you confirm me that when you try something like that you receive only data from first field into the field that is using the value list ?
Your computer is fine. You have a problem understanding what is going on. I try again with other words:
your value list shows ID plus text and returns only the ID.
wherever you attach that value list and the field has a valid ID, Servoy will show you “ID first_name last_name” matching that ID
if the user selects a different entry from the value list, only the ID will be stored (but the whole “ID first_name last_name” will be shown)
If you see that only 67 is stored, everything is like you want, isn’t it?!
What people usually do:
you want a user to be able to select a country by name from a list, but you want to store the country id
since your user doesn’t care and know about IDs, you define your value list to show the country_name and return (and not show) the country_id
If you browse to a record that has a valid country_id, Servoy will show you the country name. If the user selects a different country by its name Servoy will store the ID.
I don’t think I have more words to this …
If you come from FileMaker, you have a concept where you can return the ID but also show the name. In Servoy, you don’t even have to show the ID.