Select to view content in your preferred language

Adding media to choices in external choice list

1843
13
05-26-2022 12:47 PM
Sarah-CodyKnight
Occasional Contributor

Hi there,  is there a way to add images to choices in an external choice list in Survey123 Connect? I tried creating a "media::image" column in my external choice list .csv and putting in the name of an image in the media folder, but this did not work.

I am using an older version of Survey123 Connect, so that may be it too.

13 Replies
IsmaelChivite
Esri Notable Contributor

Hi @Sarah-CodyKnight . The media column is not supported with external choice lists.

0 Kudos
DougBrowning
MVP Esteemed Contributor

I am using select_multiple_from_file and then in my csv I have a column called image and it all works fine.

DougBrowning_0-1654534677267.png

Give that a shot.  Hope I am reading your question correctly. 

Scott_Sambell
Frequent Contributor

Doug! You have made my year and its only 4 days in! The reason for that is that i was stuck on this hurdle for the entire of 2022.  I have a select_one list of over 8000 choice and its imperative that every single one has a thumbnail. We've been creating the world's dodgiest internal choice list until now. You've just got us over the line with this one -  i cant thank you enough!!

Scott
DougBrowning
MVP Esteemed Contributor

Well now you made my day!   Always cool to help.  Also be aware that I was remaking some of my old forms last week and I noticed that 123 calls the column media::image now in the new schema on the choices tab. image still seems to work but if you have issues try media::image.

Also note with 8,000 images make sure they are as small as possible.  We had our kinda graphics person crop them down, crank up the compression and test different formats.  I think a really compressed JPG was the winner over png.  We got most down under 40 KB which helps a lot when downloading the form.  It was ok on speed but I only have 144.

good luck

0 Kudos
Scott_Sambell
Frequent Contributor

Thanks Doug. 

Yes, this project has been an epic experiment in how far you can push Survey123.  We have made a rule to keep the media folder smaller than 500MB for as long as we can (an arbitrary number i came up with). The external csvs and jpgs are automatically populated by an FME workbench which compresses the jpgs to between 50KB and 80KB.  This seems to be the sweet spot for us.  Webforms stopped loading a long time ago but the app is handling it beautifully. 

I'm publishing the next version of the form now.  I felt like i really had to get those choice lists external before we pushed past 10,000 choices so you've saved me just in time i reckon.  Hopefully this is will keep us going to 100,000 (which is what the client has estimated we will ultimately get to).  I'll let you know when it finally breaks!

Scott
DougBrowning
MVP Esteemed Contributor

Ok here are some newer tips I learned with big lists.

With select one from file I have pushed to 6-8,000 per list with up to 11 of these lists in one form.  So 65,000+ total.  to help with speed I do lists by state like this

DougBrowning_0-1672931235537.png

Then in my form I use the newer search appearance that allows me to dynamically pick the right csv and pull out just the matches I need from that one csv all at once.  Game changer on speed for sure.   


autocomplete search(${SpeciesListName}, "matches", "Plants", "Y")

The ${SpeciesListName} field is just a calc using a state code field ${SpeciesState} + 'LenticSpeciesList'

If you can find some way to filter by state or some other thing, then break up the csv files it could help.  Basically try to filter that list as much as you can before getting to the drop down.  Seems like this would let you really push it.  Form download will be the pain point with all the images but that can be done on a solid connection.

Hope that helps let us know how it goes.

0 Kudos
Scott_Sambell
Frequent Contributor

Hey Doug.  Thanks again for your great advice.

I have been thinking right from the start on this one how i could split the list into seperate lists but due to the nature of the survey i don't think its possible.  

You see this survey is to track the movement of boats in harbours and marinas throughout all of New Zealand and due to the nature of this, there is no way we could split by region (our equivalent to a "state").  Basically the user needs to recall a boat in the catalogue and see where it most recently came from, when it was inspected, if there were any hazards and, most importantly, the biosecurity details of the most recent survey so they know if the boat has potentially transported a biosecurity threat to their area. (there is a LOT of pulldata going on in this form, and the launch code from FieldMaps is about 10 lines long now)

So anyway, every single boat needs to be in the same list because they have no idea where that boat may have arrived from.  And here is the kicker - there is no boat registration in New Zealand. So we are assigning unique IDs to every boat entered in the catalogue using a clever FME process which uses the attributes of the boat (name, hull colour, trim colour, length, type etc) and a QC process that looks for potential duplicates.  The user searches one list by Boat Name (which is sometimes NoName if the boat doesnt have one) then the next select_one question shows a filtered list of all boats with that name and thats where the thumbnails are.  So i guess the first list is filtering the second list and thats why the "pick your boat from this list" question (with the thumbnails) which is "searching through" the 8,000+ BoatIDs, runs so fast.

I wish i could explain this system better.  It seems to be working though because the client is stoked.  Apparently a few others have tried to make it and couldn't get past the "Unique BoatID" hurdle but FME saved the day on that one.

Anyway the latest version with your solution has published. I'm going to be testing it all day and then release it Monday morning for the field team to use.  We'll see if they notice the difference in speed with the external CSV lists.

Thanks again!

Scott
DougBrowning
MVP Esteemed Contributor

Wow that sounds like fun lol.  Getting unique keys is always hard.

I would prob just go for it then and see.  Hopefully they have good powerful tablets.  But I have to say with the latest versions of 123 it is way faster and can handle a lot.

If it gets slow try and think of a way to cut the list down or break it apart.  Like maybe pick the color then it filters.  But I think it sounds like that is what you are doing with name.  I would check out search appearance vs choice filter as it seemed faster - but you would need to test.  Also linked content on the csv makes updates a lot easier.

Good luck!

0 Kudos
Scott_Sambell
Frequent Contributor

Linked Content!! Aaahhhhhhh.  Why didnt i think of that.?!  Thats why it wasnt working! I was trying to use Hosted Tables (using the search appearance option) in my select_one list and the thumbnails weren't showing up.  I should have added the Hosted CSVs to linked content and done it that way! I just tried it and it in my test survey and it worked perfectly! Finally we don't have to republish every time we update the boat catalogue. (which used to be every week).

Thank you thank you thank you yet again Doug!

Now all i need to do is figure out how to add additional boat images to the media folder without republishing.  I wonder if that is possible to do in linked content as well?

(btw powerful tablets is not a problem on this one fortunately.  I told the client from the very start that i would not take on this job unless i get to dictate what devices they use, so everyone is using the latest iPad or iPad Mini.)

Scott