Forums

Dynamic data text key

studio16 12 Oct, 2017
Hi

I use a db read on load to fill a dropdown if a from field has a zip code
I added a dropdown to the form with dynamic data enabled.
Is it possible to use multiple db fields as text key in that dropdown?
For example i populate from db via a db read id, zipcode and city.
I need in the dropdown <option value="id">zipcode - city</option>.

I also use an ajax event (Designer tab) (another db read + custom code) to fill the dropdown while typing.
The ajax event works great and i can manage the options via
$options[$d['id']] = $d['zipcode']." - ".$d['city'];

Can that be done also for the onload db read?


Using V5 by the way
GreyHead 18 Oct, 2017
Hi studio16,

You should be ale to use Custom code either to add a custom query that concatenates the column values' or after the DB read to do the same after the data is read.

Bob
NJM 20 Oct, 2017
Hi there,

Thanks for the info. I have the same question.
How do you obtain the values, to concatenate them?

I mean :
When you load the DB via DB read and the ModelID is "user" -> which contains 'name' and 'firstname'.
How do I approach those values then?

Something like user[name] ?

Thanks!
GreyHead 21 Oct, 2017
Hi NJM,

Please see this FAQ. To see exactly wht data you have after the DB Read you can add a Debugger action temporarily.

Bob
This topic is locked and no more replies can be posted.