[SOLVED] How to display unique values for a dynamic dropdown?

Hi Team,

I have a dropdown that is displaying its option based on dynamic data search for a Task thing that contains a field called ‘accomplished’ (type: yes/no), although I am struggling to display only unique values in the list…any ideas on how to achieve this?

1 Like

Can you use :unique? If the type of content of the rep group is text, that should do it.

And if it’s numbers?

Also, tangentially - we wanted to have a range dropdown. So something like: 0-1, 2-3, 3-4, etc., or <1, <2, <3, etc. Is there a way to do that? And if so - how?

Should work the same, you can have uniques on numbers I think, no?

For a range, you’d have to create a custom type of things ‘rang items’, for instance, with a min and a max, and use that in a dropdown.

1 Like

I’m getting this error when I specify :unique elements

that’s because you have an inconsistency between the types. the type you picked is ‘Task’, but you’re getting the autocompleted field of the tasks.

ok so, what I am trying to achieve is the ability to select from the dropdown the unique values of the completed fields.

I have a similar problem with the next dropdown element that displays the Seeker (user), it repeats the entries if the name is the same…

How can I get to what I am trying to achieve?

The selection then is an input to search/filter the entries in the RG group below…

so in a practical example, the user should be able to select all those Tasks where the Host = Richard Jennings…

I know it can be achieved by manually entering the name in an input, but I want to avoid that.

so @emmanuel to be clear…

would I have to put the values that I want to display on the dropdown into a separate table in the DB in order to get unique values?

I think so, but can you share a link so that I check what you’re doing?

what I’m doing at the moment is searching for all the records and using the values of the completed fields in the DB as selectable options in the dropdown.

for example, if I have a field called Status which can have 3 values only eg; Accepted, Pending and Rejected…

If I have a list of say 10 records with all the status as either Accepted or Pending (zero Rejected)… in the drowpdown there is no point as having ‘Rejected’ as a selectable option as there are no records with this value.

I am doing the same with the dropdown for Host, I want to only have options that actually exist, eg; those Users that are actual ‘Hosts’ available to be selected in the dropdown box, as oppose to having all users of the application.

The issue is that the Search pulls all the records correctly and I can even apply :unique elements to this…but I can not specify :unique elements to the ‘Option caption’…seems that it may be a gap here with Bubble possibly?

hope this makes sense?

You can do this if you set the type to text.

9 Likes

thanks @NigelG

this works perfectly until I start extracting elements from an Address field (type: geographic address) eg; City, State etc… to use in the dropdown. As the values are extracted as ‘text’ to be uniquely used, they don’t appear to work to search and display in the RG…

how can I use the value selected in the dropdown to search/display the data in the RG below? so in other words, how can I convert a text back to a ‘geographic address’ to be used in the search for Vaults?

Thanks all, this was very helpful. They key for me was understanding to set the type to ‘text’ in the dropdown.

1 Like

Hi

I have this same challenge. Were you able to get this resolved? If you did can you share how you resolved it?

Thanks a lot to Mr. NigelG, the TEXT type save my day :slight_smile:
That man is very generous helping people all around accross all the forum’s topics.
Many thanks !

Thanks for your contributions. I have a similar issue attempting to display in a dropdown the unique values of a Venue thing. In this case, it is a City and State. However the option for :unique elements seems to not be included. Currently, it lists the various City values of a Venue but repeated. How may I achieve this? Thanks again!

Merci !! ça fonctionne parfaitement

Did anyone manage to solve this scenario or can link to the solution? Thanks.