We currently have a form that accepts multi-select and noticed that there was a similar posting in Febraury to the issue I am currently experiencing.
I currently have multiselect enabled and it works fine in the form but when i save the form and go back to it, the multi-select option is empty once again.
I do not have that checkbox selected. I have other elements on the form that work completely fine (single select, and text field, and text area inputs). Everything else on the forms populates as it should.
When I select the form and look at the data values within that form, both marketplace_coverage and geos_jordan_coverage have their data in there.
Sadly, nothing shows on the form though despite seeing that the data is there in the backlog.
Also, not too sure if the data type that the column is will impact the results? This is what it looks like from the database side:
i went ahead and added the bracket to show it's an array but still the value isn't populating on the form. it shows the data that should be selected on the right but on the left, it is still showing up as blank.
That seemed to work only for the marketplace_coverage (kind of). Issue now is that the same values show each time for the marketplace_coverage for different products despite then having different values for the marketplace_coverage.
With the geos_jordan_coverage, I can't get any of the tags to show in the selector despite there being data selected. Everything matches marketplace_coverage but it does not work.
If I were to change the column type to JSON, would I do that in the database? At the moment i have several different types of formats that are primarily comma separated strings. Would I need to reformat them in order to allow the JSON to work?
The easier way would be to store the data as a JSON, in this way you don't need to transform the data for the table and multiselect components, and you can keep your modifyProduct query as it is. But if reformat is not an option you will need to play with the data to make it work in all cases.
This is how the data is being stored in a JSON column using form1.data
In that case I will need to convert the data prior to changing it to a JSON type because right now I get an error when trying to change it as it is now: Error: invalid input syntax for type json
So the new format will be with just brackets([])? No more curly braces? ({})
Old format:
(empty)
All
NA; EMEA; APLA; Global
{"APLA","Big 4"}
New Format:
[]
["All"]
["NA", "EMEA", "APLA", "Global"]
["APLA","Big 4"]