Conditional Visibility based on Many-Many Relationship

Hi everyone,

I’m trying to setup conditional visibility based on a User Property that is a Many-Many relationship to another collection.


I have the set the condition to “Contains” and then the name of the Collection Record that I want to be present in the User’s Relationship property in order to make that component visible. In testing, this did not seem to work. I also tried using the Adalo ID from the API for the corresponding record but that also did not work.

Has anyone been able to figure out how to do this with Many-Many relationship properties?

Without having access to the app this would be difficult to troubleshoot. If you are in a position to grant me access to have a look then I will see if the issue can be resolved.

I’ve setup a copy of the app with the necessary data for you to take a look.

Can you send the link please

Could you add me to the team on the copy of the app please, then I can see how the collections are made and how they link up

So to be able to filter by these many-many collections, you have to specify which specific record should be evaluated. So instead of the “Red Wine” static text you have there, you would need some red dynamic text to evaluate with. If you just say “Where this collection contains Red Wine”, Adalo doesn’t know which property it should be looking at. One way around this is to use the Count option instead. You can say, "This should only be visible if the user’s categories’ count where the name contains Red Wine is greater than 0.

@pfordmedia that is a great tip thanks so much!

So I have this sort of starting to work. My use case is that I am asking users to select a sub-category for each category that they selected from the previous screen, so if a user selects Red Wine, the dropdown menu to select a type of red wine should appear in this modal. Which it does here.

The problem I am now seeing, is that each user can add up to 5 categories to their preferences (the many-many relationship I described previously) however this modal is only showing the first component (Red Wine drop down) even though I set up identical drop downs with identical conditional visibility as per your method.

Is this a known problem where I can’t have multiple conditional visibility components on the same screen?

If you copied the dropdown over and over, you’ll need to reset the visibility back to Always visible for the copied dropdowns and then reset the visibility to Sometimes with those conditions. Don’t ask me why but copying things with visibility conditions sometimes breaks them and they have to be reset - don’t ask me how I know that one. Lol

Let me know if that doesn’t work though.

@pfordmedia Yup that was exactly the problem. Thank you so much once again!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.