Select to view content in your preferred language

Is it possible to auto-update WEBFORM choice lists using linked content .csv's?

580
4
Jump to solution
10-30-2023 01:19 PM
Vinzafy
Frequent Contributor

Hey all,

I saw this thread back in 2021 with the same question, but it was never fully resolved.

Question

How are choice lists that are populated using linked content .csv's updated in webforms?

Is there an automated check for updates to linked content as in the Survey123 app?

Or do choice lists via linked content require the survey to be re-published for the updates to appear in a webform?

Background

I understand that checks for updates to linked content csv's are performed in the survey details page on the Survey123 app, and that this check is bypassed if surveys are launched via URL parameters.

However, one of my surveys are used exclusively as a web form. There is one field that is a list of companies (300+) that is populated using a linked csv. If I update the csv on AGO, the only way those updates are pushed to the webform is if the survey is republished from S123 Connect with the updated csv in the media folder.

Is this the only way to update choice lists via linked content csv's for web forms?

Thanks all!

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

My apologies. I'm not sure I understand. See below for clarification. I believe you are wanting Option #1?

Option #1: A select_one or select_multiple set up as an External Select (e.g., select_one_from_file my_file.csv) should not need any interaction from Connect if set up properly.

Once you publish the form for the first time you can:

  1. Go to "Linked Content"
  2. Click on "+ Link content"
  3. Choose "CSV"
  4. Select your hosted CSV from the list
  5. You will see a download icon next to your CSV. This is both optional and annoying (see Notes at the end). To keep it simple, I would recommend clicking this button the first time you link to the CSV... and any time you republish the form in the future if the CSV has been updated.

abureaux_4-1698700854939.png

Now, when someone visits the webform, they will get the CSV. Subsequently, if you update the CSV on your portal, they will automatically get that new CSV's content when they reload the survey/page. Again, you do not need to use Connect at all.

Option #2: If you either put your select options into the "choice" tab or upload a  CSV to the "media" folder (super similar to Option #1, but without the steps I described above), then you are 100% required to update the select list on your local machine and use Connect to republish.

abureaux_2-1698700553346.png

or

abureaux_3-1698700583814.png


Notes:

  1. For YOU AND ONLY YOU to test your form in Connect, you are required to have something in the media folder. So clicking this button will put a CSV there so you can test. However, you can also publish with an empty 'media' folder and the form will work fine, but this leads to #2...
  2. Leaving the media folder empty means that when a user downloads your survey in the Field App for the first time (not an issue in your case), they will have an empty list. As such, they will need to close the survey immediately after downloading, then reenter the survey which will auto download the most recent CSV. But this leads to #3...
  3. But, if you do decide to include the CSV in the media folder (aka, you did what I recommend in step #5), then your users will have immediate access to the drop-down list, but they won't have the most recent CSV if you published an update since the form was published. This is what I meant when I said "I would recommend clicking this button ... any time you republish the form in the future if the CSV has been updated"

I've made two separate suggestions in the Ideas form to get this behaviour changed.

Whereas you are using a webform, these issues won't actually affect you, but I thought they were worth mentioning.

View solution in original post

4 Replies
abureaux
MVP Frequent Contributor

By webform, you mean a survey accessed via the web and not the app?

If that is the case, I'd use an external select. All webforms will automatically use the most recent CSV. External selects do not require anything be in the media folder; but, you need to publish the survey before making the link in Connect (a little annoying).

Vinzafy
Frequent Contributor

That's correct! And thanks for the clarification. The previous workflow was to use external selects, but I was hoping to switch it to linked content with the idea being that the .csv is all that's required to update for the web form list to refresh.

Unfortunately like you mentioned (and testing reflects) it does not seem to function that way for webforms, and that either workflow still requires re-publishing via S123 Connect. Thanks for your comment!

0 Kudos
abureaux
MVP Frequent Contributor

My apologies. I'm not sure I understand. See below for clarification. I believe you are wanting Option #1?

Option #1: A select_one or select_multiple set up as an External Select (e.g., select_one_from_file my_file.csv) should not need any interaction from Connect if set up properly.

Once you publish the form for the first time you can:

  1. Go to "Linked Content"
  2. Click on "+ Link content"
  3. Choose "CSV"
  4. Select your hosted CSV from the list
  5. You will see a download icon next to your CSV. This is both optional and annoying (see Notes at the end). To keep it simple, I would recommend clicking this button the first time you link to the CSV... and any time you republish the form in the future if the CSV has been updated.

abureaux_4-1698700854939.png

Now, when someone visits the webform, they will get the CSV. Subsequently, if you update the CSV on your portal, they will automatically get that new CSV's content when they reload the survey/page. Again, you do not need to use Connect at all.

Option #2: If you either put your select options into the "choice" tab or upload a  CSV to the "media" folder (super similar to Option #1, but without the steps I described above), then you are 100% required to update the select list on your local machine and use Connect to republish.

abureaux_2-1698700553346.png

or

abureaux_3-1698700583814.png


Notes:

  1. For YOU AND ONLY YOU to test your form in Connect, you are required to have something in the media folder. So clicking this button will put a CSV there so you can test. However, you can also publish with an empty 'media' folder and the form will work fine, but this leads to #2...
  2. Leaving the media folder empty means that when a user downloads your survey in the Field App for the first time (not an issue in your case), they will have an empty list. As such, they will need to close the survey immediately after downloading, then reenter the survey which will auto download the most recent CSV. But this leads to #3...
  3. But, if you do decide to include the CSV in the media folder (aka, you did what I recommend in step #5), then your users will have immediate access to the drop-down list, but they won't have the most recent CSV if you published an update since the form was published. This is what I meant when I said "I would recommend clicking this button ... any time you republish the form in the future if the CSV has been updated"

I've made two separate suggestions in the Ideas form to get this behaviour changed.

Whereas you are using a webform, these issues won't actually affect you, but I thought they were worth mentioning.

Vinzafy
Frequent Contributor

Thank you for such a thorough response! Very much appreciated. Option 1 worked great and as described. When updating the linked csv in AGO, the choice list automatically updated in the webforms without any use of Connect using select_one_from_file <name>.csv. Awesome!

0 Kudos