Multiselect default value

Hi All

what I woudl do is
After user authentification, extract the list from DB and pass to mutiselct section as defalut value.
Then user would edit the multiselect value either deleting value or adding new value from defalut value.

issue I am facing
I could show the multiselect defalut value which extracted from DB. however if i try add new value or delete one of value, all value will be cleared.
recoding is store in this url.

appreciate if you could give some advice.

Hi @Kenichiro_Ouchi,

First, welcome to the Stremalit community :tada: :tada: :partying_face:

To me, this looks like you might need to use session state to track values in the multiselect. But I’m not sure why you use a textbox to pass to a multiselect in this way. It seems to me that you want to filter the database first based on what the textbox has?

If so, I have a question: wouldn’t the built-in text-matching of the multiselect work for this? and if not why not?

To truly help, I would recommend adding a MWE (minimum working example) of code.

This is a helpful forum post about posting your first question on the forum:

Happy Streamlit-ing!
Marisa

thanks for your comments
what I would do are

  1. get the reigstered pickers from DB
  2. show tickers as defalut value at mutiselct section
  3. if user would change(add/delete) the tickers, they can edit in mutiselct section
  4. if user press the bottom, update new tickers list to DB.

however if I tried to change(No.3), all value which showed as defalut value are all cleared. and need to input from scrach.

if we have a sample code or link I can check, could you share to me?