cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Gallery Template fill based on value in 2nd gallery

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.

 

GalleryCompare3.png

 

GalleryCompare1.pngGalleryCompare2.png

 

Would appreciate suggestions and recommendations.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@JR-BejeweledOne 

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) 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

JR-BejeweledOne
Super User
Super User

Got it!

 

Even though Gallery2.Date was showing as a Date, it wasn't comparing that way.  This works.

 

GalleryCompare11.png



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

23 REPLIES 23
RandyHayes
Super User
Super User

@JR-BejeweledOne 

What is the Items property of Gallery1?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Rivius
Resolver III
Resolver III

Is your second gallery embedded in the first?

JR-BejeweledOne
Super User
Super User

It really is just dates.

 

Sequence(If(DateDiff(varFirstDays.January, DateAdd(varDates.January, 1, Months), Days) > 36, 42, 35))



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

No, it isn't.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
RandyHayes
Super User
Super User

@JR-BejeweledOne 

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?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Rivius
Resolver III
Resolver III

Try using collections as a data source instead of the gallery as a data source.

RandyHayes
Super User
Super User

@JR-BejeweledOne @Rivius 
You most certainly do NOT need a collection!!  Please only use collections for their intended purposes.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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))

 

GalleryCompare4.png

 

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.

 

GalleryCompare5.png

 

I also added a label in Gallery2, that has the same number value as Gallery1



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
RandyHayes
Super User
Super User

@JR-BejeweledOne 

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) 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,118)