ODK 2.0 Application Designer: CSV file with image reference

Hi

I currently have a csv file with three column one for the value another for the label and one for referencing the image corresponding to each value.

I want to know is it possible to display the list of values in the csv almost like when you fill the choices sheet in and have a display.image file.

I tried something like this:

"_.map(context, function(species){
species.name = species.name_key;
species.label = species.name_Eng;
species.data_value = species.name;
species.display = {text:species.label};
species.display.image = {text:species.image}
return species;
})"

But it doesn't seem to work.

If anyone can send me in the right direction or tell me how far I am off that would be great.

Thanks for your time.

Werner

It is possible to use a csv file to populate the choices of select prompt.
Your example above is very close but should look more like the following.

_.map(context, function(species){
species.data_value = species.key;
species.display = {text:species.Engname, image:species.image};
return species;
})

I have attached an example of how to do this in the following zip file. In
particular, you will want to look at the birds_csv query in the queries
sheet. This example works with rev 204 of the Application Designer.

Clarice

selects.zip (1.41 MB)

ยทยทยท On Thu, Jul 7, 2016 at 7:03 AM, wrote:

Hi

I currently have a csv file with three column one for the value another
for the label and one for referencing the image corresponding to each value.

I want to know is it possible to display the list of values in the csv
almost like when you fill the choices sheet in and have a display.image
file.

I tried something like this:

"_.map(context, function(species){
species.name = species.name_key;
species.label = species.name_Eng;
species.data_value = species.name;
species.display = {text:species.label};
species.display.image = {text:species.image}
return species;
})"

But it doesn't seem to work.

If anyone can send me in the right direction or tell me how far I am off
that would be great.

Thanks for your time.

Werner

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

This seems to work now thank you for your help.

Werner