I have a favorites tab within my app. If a user has yet to favorite an item, I would like to display text that says they have not favorited anything yet. I’m stuck on visibility since the text component is using the favorites sheet, which essentially just has headers (title and subtitle) and as a placeholder for the tab. My question is how to bring over the favorite data to this sheet when there isn’t any data within it.
I believe you can use a rollup pointing to the “is Favorited” column and set to count true. If rollup is 0 then you display the text.
Also, you should have a seed column with a value in there to generate a row for the rollup to populate.
Thanks! What’s a seed column?
This is what I created, but the correct number is 6 not 13. I figured out why, it’s counting old events as well. I have two sheets for favorites (business and events) so I created two roll-ups. The events rollup however will also have to take the date into account, not sure if that’s possible.
A seed column contains a placeholder value so that Glide can actually generate a value for computed columns, it can be anything you want.
For the date problem, create an If Then Else column in your events Sheet, if date is before today then false, else true. Create a template column combining the favorite column and the ITE column above with the format “value1 - value2”, pointing to the correct columns.
Then in your Favorites sheet, create a template column with the value “true - true”, make a relation from this template column to the template column in the Events sheet. A rollup on top of that relation will return the correct count.
Thanks! This should have which values in its place?
No, that shouldn’t have any values. It’s the “correct” text to use in the relation. You only need to replace the template column in the Events sheet.
So like this with no replacements?
Yes that’s true. Please mind the format of the template column when you do it in the Events sheet (it should be value1-value2 without any spaces like what you do in the screenshot above).
ok thanks! I did the relation after this with the templates from the event sheet and favorite sheet and it produced the title of one of events in a single cell.
Do you mean this in a relation column?
Ok, so I need to create a lookup?
I have the following:
That’s a single relation, so doing a rollup count will always return 1.
Should I check off match multiple?
Yes, if you need data from multiple rows.
- Check multiple if you want a relation to potentially find multiple matches. Even if it finds one match now, it could find and return multiple matches in the future.
- Leave it as single if you want a relation to only ever find one match. If there is only one match, then it will find it. If there are multiple matches, then it will still only return the first match.
I see. thanks! The rollup is still 1 however, even though I see there are multple relations.
Ok I think I see, it should be rollup on the same relation then point back to the favorites column in the events sheet?
Does this also count favorites without an end date? Some do not have an end date, but they were favorited.