Streaming live at 10am (PST)

How to conditionally show a dynamic message based on data from another collection list?


#1

Hey there!

I have this website set up with different collections that cross-reference each other. The Events collection shows events that are taught by different teachers, so it pulls data from the Teachers collection (teacher photo, name, location, etc.) and now I want the teachers list to be able to tell if they have an event that’s posted and show that on their teacher card on the teachers page — basically I would just selectively show/hide a box to show whether or not they have an event posted, like so: https://www.screencast.com/t/D6chuycZE

But when I try to use conditional visibility to show the “events posted” div only for those teachers who have an event set, I don’t see that as an option (since there’s not a direct reference from the teachers list to the events, I suppose). It doesn’t look like it’s a 2-way street in this way. The only database items I can access in that dropdown are in the Teachers collection, not the events collection.

So in short, I’m trying to figure out how I can make it so I can pull event data into a teachers collection list.

Any ideas on how I can accomplish this? Thanks so much!

Here’s the share link:

https://preview.webflow.com/preview/continuum?utm_source=continuum&preview=a6eb898a267de750480318c898dd41e0


#2

Webflow released a few months ago an update in that regard, you can see the update here:

The thing with this solution is that it doesn’t go as deep as we would’ve wanted but it’s a start.

Hope this helps.


#3

Yep, I remember that being updated. So the short answer is “It’s not possible … yet”?


#4

Instead of using conditional visibility, why not use a second reference field for the events and link it back to the teachers.

You should be able to reference it that way and then setup your conditional visibility that way.


#5

Hey @WebDev_Brandon! I tried that (at least what I think you’re pointing to), :smiley: but when I added a reference field in the Teachers collection to pull from events, then that field would force me to choose one event for each teacher instead of being able to dynamically know which events that teacher “owns” to then be able to use conditional visibility on the div … Does that make sense?


#6

hmmm, sorry for the delay, can you add your share link here, so I can see what you are referring to? Unless you have already found your workaround?


#7

Yep, I had the share link in my initial post. Here it is:
https://preview.webflow.com/preview/continuum?utm_source=continuum&preview=a6eb898a267de750480318c898dd41e0

Thanks for the help!