Buy Now
Sign in

Fields to retrieve - read data

Daniele.Ruggiero , December 13 2017
Answered
D
Daniele.Ruggiero
Hi,
i have a mysql table (named Comuni) with all the italian city. I have to populate a dropdown control (named Citt) with the names of city.
Using a read data (read_data15) control, which values goes in 'fields to retrieve' field?
Please see also the screenshot attached.

structure of table Comuni:

CREATE TABLE IF NOT EXISTS `comuni` (
`Istat` int(6) default NULL,
`Comune` varchar(35) default NULL, ----> name of city
`Provincia` varchar(2) default NULL,
`Regione` varchar(3) default NULL,
`Prefisso` int(6) default NULL,
`CAP` varchar(5) default NULL,
`CodFisco` varchar(4) default NULL,
`Abitanti` int(7) default NULL,
`Link` varchar(38) default NULL
)
Attachments
Schermata_2017-12-13_alle_21.23.45.png
Schermata_2017-12-13_alle_21.23.45.png
(53.69 KiB)
249 Downloads/Views
admin
Hi Daniele,

In the "Select type" please use "Key/Value pairs" and in the fields to retreive just use "Comune"

Then use {var:read_data15} in the options box of the dropdown!

Best regards
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Daniele.Ruggiero
Thank you so much! it was simple, now it works!
T
touretteroma
Dear all,
using {var:read_data15} returns a structure like {"Roma":"Roma"}.
How to get just the value "Roma" to be used sending an email?​
​I'm trying to get value using {var:read_data15[0]} or {var:read_data15['0']} or {var:read_data15['Comune']} but I always obtain an empty string
Please, could you help me?
GreyHead
Hi touretteroma,
I think that you are trying to do something completely different - this thread is about reading data to populate a drop-down. You should be able to get the selected value of the drop-down using {data:input_name}
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
T
touretteroma
Dear Bob,
I created topic https://www.chronoengine.com/forums/posts/t105472 to better explain my case.
Regards
Tourette Roma