#Multi-select widget not saving correctly to DB
1 messages · Page 1 of 1 (latest)
@inner gate It seems to be working ok just now, Ill keep an eye on it and start another post if it plays up again
Ill see if I can notice a pattern
@inner gate I am still having the problem where some entries are saving with the [] and others are not, when they save without the brackets, it doesnt display correctly when viewing/editing
my insert query
Properties pane -
Hey Paul! Let me experiment with this a little.
@drifting thunder You should be able to do MyForm.data.Multiselect.toString() to turn the array into a comma separated set of items. Do you need each item to be quoted or can you quote the whole set together for the entry?
@still imp if all items were saved as ["a","b","c"] it be happy. But for some reason it sometimes gets saved as "a","b","c" without thr brackets
Do you want the brackets to be there?
If that's the case, you can use "[{{MyForm.data.MultiSelect.toString()}}]"
Using a text box for testing, but this is the output of that:
It would be helpful to know exactly how you'd like the values to appear in the db 🙂
@still imp if they are saved in the form ["a","b","c"], when I edit the form, the values are displayed in the multi-select box and I can remove or add as required.
If they are saved without the [] then when I edit, the multiselect widget dies not populate
@still imp the video should show what I mean
@drifting thunder Is this the only multi-select in your app that works like this or are there more?
If you use this '["{{Form1.data.MultiSelect1.join('", "')}}"]' then it will turn the array into this for the query '["GREEN", "BLUE", "RED"]'
I only have one multiselect column
Why does it not save in a consistent fashion? I'd have thought that all entries should save in thd same format
I'm not sure about that one. I'll ask the Eng team about this 🙂
Ill keep an eye on it, see if I can spot a pattern
@still imp I have been checking every entry I put and what I have noticed is that the Entry which is saved, saves fine... but occasionally, other entries then have their brackets removed which I am finding quite strange... As the information I am working with is live, I will send you a video via private chat to show what I mean