Objective
In my app, the user can upload a file which is used for the following steps. This file is reused across multiple entities of the app, so it is automatically saved on a VM. The file can get quite heavy, so I want to allow the user to only upload it once and then reuse it in future app entities.
Ideally, the user would have 2 options: upload a new file, or select a previous one from a dropdown menu. How can I dynamically populate this menu, based on the files available on the VM at a given location?
Workaround 1
Instead of an OptionField, the user enters the name of the file in a TextField. However this fails if there’s a typo.
Workaround 2
I regularly go on the VM, get the list of files, update the options of the OptionField and re-publish the app. That would require very regular maintenance…
Workaround 3
Add a “get files” button that returns the list of files on the VM as a json, the user goes through the list, finds the name of the file they want, and enter that name in a TextField. That’s a bit safer than the first workaround but still not fullproof, and quite cumbersome for the user.
Solution
Any better ideas?