I need to set the template fill of a gallery if the date exists in a 2nd gallery.
Gallery1 - Dates
Title - Number
Subtitle - Text
Label7 - Number
Gallery2 - (Vertical Blank Flexible Height) Items
LabelDate - Text
LabelHoliday - Text
If Gallery1 Subtitle (text date) is in Gallery2 LabelDate (any item), then I need the template fill to be a color other than white.
In trying to do this, the only comparison option I have in Gallery1 is ThisItem.Value. I can't select one of the controls inside the gallery item. ThisItem.Value evaluates to a number but it won't allow me to use the = operator to compare to the number field inside gallery2.
Would appreciate suggestions and recommendations.
Solved! Go to Solution.
So, since you already have a label with the text converted date and the date in the second gallery is also in a text format, then you can set your formula to the following:
If(LookUp(GalleryHolidays.AllItems, Label7.Text = Subtitle.Text, true), Style.DayBG, White)
Got it!
Even though Gallery2.Date was showing as a Date, it wasn't comparing that way. This works.
What is the Items property of Gallery1?
Is your second gallery embedded in the first?
It really is just dates.
Sequence(If(DateDiff(varFirstDays.January, DateAdd(varDates.January, 1, Months), Days) > 36, 42, 35))
No, it isn't.
So it's based on Sequence, so then Value is the only column that will be available in the ThisItem.
Is it that you are trying to find one of those numbers in Gallery2, or is there something else that you want to compare?
Try using collections as a data source instead of the gallery as a data source.
@JR-BejeweledOne @Rivius
You most certainly do NOT need a collection!! Please only use collections for their intended purposes.
That is exactly what I need to do.
If the date exists in Gallery2, then the templatefill needs to be a different color. The highlighted label is the number and it's 'Text' value is: Day(DateAdd(varFirstDays.January, ThisItem.Value, Days))
In Gallery2 the date is text. I have tried wrapping it in DateValue and comparing, no error, but it also doesn't give me what I need. You can see no error, but the background for any of the dates that exist and there should be 2, in this scenario are not changing color.
I also added a label in Gallery2, that has the same number value as Gallery1
So, since you already have a label with the text converted date and the date in the second gallery is also in a text format, then you can set your formula to the following:
If(LookUp(GalleryHolidays.AllItems, Label7.Text = Subtitle.Text, true), Style.DayBG, White)
User | Count |
---|---|
122 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
215 | |
179 | |
141 | |
108 | |
83 |