cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Salamander94
Level: Powered On

Make "TemplateFill" Color Gallerey Based on Two Fields

If(ThisItem.Quantity = 3, CadetBlue, ThisItem.Quantity = 2, LightPink, ThisItem.Quantity <= 1, Salmon)

This is the code I'm using to make my gallery fill in colors based on how many of the item is left.  Now I have two different browse screens.  One that has the full item inventory with no templatefill formula changes.  The second is a gallerey of the same inventory filtered out by the field "Priority".  I did this because not all items need to be restocked when low and it made my original inventory screen too cluttered.  I split them in two.  One with items that needs to be stocked and one that has all items.  Here's what I'd love to work.  I want one inventory screen, but I want the items that need to be stocked when low show up in red.  I couldn't get the "templatefill" function to just color in the items that need stocked.  It colored in all items that were low.  I tried a code like this:

If(ThisItem.Quantity = 3 and ThisItem.Priority = "H", CadetBlue, ThisItem.Quantity = 2 and ThisItem.Priority = "H", LightPink, ThisItem.Quantity <= 1 and ThisItem.Priority = "H", Salmon)

It doesn't work.  Is it possible to base "TemplateFill" off of two fields?  Or do I need to just stick with two different browse galleries?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Make "TemplateFill" Color Gallerey Based on Two Fields

Yes, absolutely.  Here is an example created using the following in TemplateFill:

 

If(DepartmentName.Value = "Test" && StatusOverall.Value = "In Progress-Target Missed",Red,White)

AA1.png

 

I recommend testing each condition independently to verify the expected records are being colored before combining the two.  You might also add a label for both columns temporarily in the gallery so you can readily verify that the condition is being met.

1 REPLY 1
Super User
Super User

Re: Make "TemplateFill" Color Gallerey Based on Two Fields

Yes, absolutely.  Here is an example created using the following in TemplateFill:

 

If(DepartmentName.Value = "Test" && StatusOverall.Value = "In Progress-Target Missed",Red,White)

AA1.png

 

I recommend testing each condition independently to verify the expected records are being colored before combining the two.  You might also add a label for both columns temporarily in the gallery so you can readily verify that the condition is being met.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 146 members 4,510 guests
Please welcome our newest community members: