Restricting a dynamic drop down, to exclude objects that already exist

I have a data type called “Streaming link”, which has fields “Streaming channel” (a data type) and URL (text). A streaming link is also a field on a Song data type.

When creating a “Streaming link” you can choose the “Streaming channel” from a dropdown, and then input the URL.

Streaming channels can be added and removed, so the drop down fields are dynamic (the result of a search for streaming channels.)

This works fine, but what I want to do now, is not allow the user to select Streaming channels that they have already input for a specific song.

So for example:

Song “yay”, has a “youtube” streaming link, but not a “soundcloud” streaming link
When creating a new streaming link for song “yay”, only “soundcloud” appears in the dropdown.

What’s the best way to achieve this? Here is a picture of the search I am using for the dropdown.

Thanks!

It may be good to set up an option set of the different link types. Like, ‘youtube’, ‘soundcloud’, and whatever other options there may be. Then each time someone creates a link have them assign that option to an attribute on the data type. Then when someone goes to add a link to a song your dropdown can be filtered by whether a link with that option exists or not.

1 Like

Hi @williamtisdale , thanks for your suggestion. Unfortunately the options are dynamic and the user will define them (they will add/edit streaming channels), as such I don’t think I can use an option set here, since they have to be predefined?

@samosa

Complementing @williamtisdale great advice you can filter lists. Options sets can also be managed as a list just like objects (or in “Bubblish” … data types).

Consider exploring how to manage lists (add/substract items from it) and this operator :filtered

This topic was automatically closed after 70 days. New replies are no longer allowed.