Hi,
We have a CSV file that stores product attributes, e.g., colors. In our survey, we would like the user to be able to update the colors for that product. When a user selects a product from a drop-down list, we want a read-only question that queries the CSV file and returns a list of the current colors for that product. This question would serve two purposes: 1) allow us to store the information in our database to see what the colors were before the user made any changes; 2) be FYI for the user so they can see the current colors.
Then, the second question would be a select_multiple question displaying a list of all available colors with the currently assigned colors pre-selected. The user would then be able to select/de-select the colors as necessary to update.
My questions are:
- How would I create the first question? If using a custom Javascript to return an array, is there an example of the script I can reference? My first attempt at this was to use a select_one question with a choice filter that returns the values based on the product that the user selected in a previous question. However, the returned values are not stored when the user submits the survey.
- For the second question, how would I design the question to return a list of all possible values with the currently assigned values pre-selected?
Thank you!