Hide objects based on a relationship condition

Hi everyone, I have a small problem that is blocking my works. I searched everywhere, watched videos but can’t find the answer. And after trying and trying the thousand ways, I give up and ask for help from you!

I have two collection:

  • User (mail, name, etc…)
  • Event (adress, date, time start, etc)
    I created a relationship between the two.
    in User --> Events you participate in
    in Event --> Mail of user

Obviously by setting that more users can participate in more events, and more events can have more users.

Later, with the intention of creating a system of “Yes / No I participate in the event”, I created a button that according to the choice:
User yes partecipate --> Update logged user --> add Event you partecipate = + Rome (example) and add user mail to “Event --> Mail of user’s”
User no partecipare --> Update logged user --> Remove Event you partecipate = - Rome (example) and remove user mail to “Event --> Mail of user’s”

I remind everyone that:
User --> Event you partecipate AND Event --> Mail of user’s
are the field in relation between the two collections (User/Event)

It’s work. I would like, however, that when the user participates in the event, on the same page appears a message “Currently you participate in the event”
I created the writing and I was thinking of managing it with the visibility settings, and here we are at the problem.

I thought I’d handle it like this:
If the logged user’s email exists/or equal in “Event --> Mail of user’s” it means that the user participates in the event and therefore it is necessary to show the writing.
BUT NO! when I select “Logged in user mail” equal etc…I can’t select the relationship field “Event --> Mail of user’s” and I’m shown endless submenus that take me nowhere.

How can I create a report to show / hide the writing, based on a user attending an event or not?
Where am I wrong?
I also tried the opposite. (Events -> participant email contains user email) and…nothig.

this in infinte submenu

this in Event collection (last field “Usermail” is the relationship with user collection)

Thanks so much to all…cheers

I’m not sure this will work for your situation but I add a true/false property to my collection and use that as my basis for hiding a component or not.

Thanks for the reply. Unfortunately, I do not think it can do for me, as I do not need to define whether the user participates or not in that specific event. but rather to know if the user PARTICIPATES IN WHICH EVENT? and vice versa (which users participate in the event?)

I don’t understand how I can query and show the data (more than one) present in the relationship fields, which contain precisely this multiple information.

Thanks so much.

I have hit the same problem too a few times now, hopefully Adalo makes it possible to do this in the future!

thanks…we wait an update from other user…

Hi @miticobeppe!

You should be able to accomplish this by making your text component a list. Then filter the list for “is participate in event contains logged in user” and then limit the list to one item.

This should work for your situation!

I have tried, but I cannot select anything for the “logged user” as filotr. (as you can see in the picture).

Where am I wrong?

Are you able to select the “all” collection in the first menu you are showing there? It’s definitely not super intuitive which can and can’t be selected.

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