Multiselect dropdown default value from DB problem

I use multiselect dropdown with values from external dictionary got from API.
User choose some options from dropdown, I save it to database through API, everything works fine.

But there is a trouble with default value. I need to get default values from the same type of data as Choices source and this is my dictionary.

Okay, but I need to filter it with user saved values. And here I can choose only single element as a constraint (not a list of them). I’ve got to compare if with list of items (saved by user in database). And there is a conflict.

As a result - empty default value.
Details you can see on screenshot.


Do you have any solutions guys?
Thank you!

Instead of selecting ‘id =’ try the Advanced option instead.

I’ll try it, thank you

Unfortunately it doesn’t work in a way I need. Let me explain.

What I need is to compare my dictionary id’s with database values.
For example if I set constraint as one ID, it works correctly.

But there are list of ID’s in value. And if add one more ID to constraint, dropdown value turns into empty.

If I try Advanced method, it evaluates as true/false. If true dropdown value returns all the options from dictionary. If false - no options at all.

Hi @as1 ,

Have a look at the filter Advanced: Thing > ContainsList.

Yeah bout somehow it doesn’t work that way.
It should evaluates as ‘yes/no’, but evaluates as empty.
image

Hi!

Please check that you are working with compatible data types.

Here is the thing:

  • dictionary - API method №1
  • saved values - API method №2

So I need to filter List №1 with values from list №2.
And yes, Bubble define them as a different types because they came from different API-methods.

In this case with two API-methods how exactly can I filter lists?

Three possible options:

Format the result of both as text on request. You might have “Format as text” available after ie. “…item’s id”.

Filter when you build your API query string.

Save the data in Data Types or Custom States and apply a filter.

Thanks, I’ll try first option.