Multiple select selected from query

Hi
really struggling. I have a simple form that has a multiple select in it. This form is used to update. So, I want the multiple select to select the values previously entered.

I have the select populated with a query from a DB, that all works.

I then do my query to select previously entered values, but not sure how or what to select in the selected value box

you can see in the screenshot my select list, i have my selected value set to the query that can be seen is an array.

no idea, lost, tried everything i can think of.

thanks in advance

image
yourquery.flatten(‘Invoice_id’).split(’,’)

thanks, i had tried that and it didnt seem to work, i have this

SC_PaymentSelect.data.PaymentInvoiceSelect.flatten('Invoice_id').split(',')

thanks

Have you thought of using Tagify?

i have no idea what that is, will have a google

nice will look into that but doesnt help with the current problem, thanks

I read this a few times but I can’t understand exactly what’s is your issue :frowning_face:

Can you explain a little more please?

I have a multi select form element. It’s values come from the dB. It is a list of unpaid invoices, which is on a form where we enter payment information, so we enter payment information and select the invoices the payment relates to.

That all works

But, if we make an error on the payment we need to edit, so, now I get the payment details we entered and dynamically populate the form, it all works except the multi select list, I want the original selected options highlighted for the edit.

I have the data from the dB and it says it is an array, but adding that to the multi select in the selected value box does not work.

Hope that makes sense? Thanks

i have also read this post

and flatten is just never in my data formatter, the flatten is just not there no matter object i select or what i tell it the object is, string, array, object etc etc, i never get flatten as in data formatter

feels like there might be a bug in wappler here, i never get flatten and, even if i enter the invoice_id manually in the selected value box its not selected

notice the dmx.bind value… and matches the option value but its not selected in the browser

and if i use the query with flatten and split, i think its wrong as well, think this should be a list of ids, instead it shows the code

@Teodor - sorry to pull you in, but you normally have the answer lol, is this a bug in wappler and this doesn’t work or am i doing something wrong

thanks

Is this related?

Yes thanks @Apple it looks to be related to the same issue, option value isn’t being selected.