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

Conditional Formatting Gallery Fields

I am trying to replicate an Access report in PowerApps.  The current report consists of a ;ist of applications with several scores - the colour of each score field is determine by the value of the field.  i.e. [Name, Score1, Score2, Score3, Score4]

 

I've not been able to duplicate this format in PowerApps:  Gallery fileds do not support conditional formatting (an error is generated when I try to use a conditional in the 'Fill' attribute) and Display Data Forms only show a single record.

 

I'm sure this can be done in Powerapps but so sar how to do it has eluded me.  Any suggestions appreciated.  

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Conditional Formatting Gallery Fields

Try changing the TemplateFill property rather than Fill property. Each row in the Gallery is a template and it is the TemplateFill property I believe you want to change.

Alternately you can put a rectangle behind the controls in the Gallery and set the Fill property of that control (or the Fill of the label controls in the Gallery).

View solution in original post

Super User
Super User

Re: Conditional Formatting Gallery Fields

Note that you have set you alpha property in RGBA to 0. That is going to make the Colour/Fill  transparent. Try setting to 1 instead.

If(Label18.Text="4",RGBA(0,125,153,1),RGBA(238,127,75,1)).

 

It should be a case of changing the label fill property, but reference ThisItem.[FieldName] rather than Label[X].Text

 

E.g. For the label where the text property is set to ThisItem.Tier

If(ThisItem.Tier = 1, Red, RGBA(0,0,0,0))

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Conditional Formatting Gallery Fields

Try changing the TemplateFill property rather than Fill property. Each row in the Gallery is a template and it is the TemplateFill property I believe you want to change.

Alternately you can put a rectangle behind the controls in the Gallery and set the Fill property of that control (or the Fill of the label controls in the Gallery).

View solution in original post

KJH1138
Level: Powered On

Re: Conditional Formatting Gallery Fields

Thanks for the response but still no luck. 

 

TemplateFill affects the entire row - what I am trying to do is set the colour of the individual labels within the row

 

i.e. if the row contents was 'Application 1, 1, 3, 5' I would want the box fill around the '1's to be red, yellow around the '3' and green around the '5'

 

I tried adding a blank label (Label23) to the gallery and placing "If(Label18.Text="4",RGBA(0,125,0153,0),RGBA(238,127,75,0))":   Label18=ThisItem.Tier which has a text value of "1", - , "5".  The blank label appears in each row but itr's fill colour does not change.

 

I do note that when I begin typingIf(Label18 ... PowerApps displays the message "This formula uses scope, which is not presently supported for evaluation" 

 

I receive this message whether I put in the Galery label (Label18)that is linked to the data or in the unlinked Gallery label (Lavbel23) that references it.

 

 

Super User
Super User

Re: Conditional Formatting Gallery Fields

Note that you have set you alpha property in RGBA to 0. That is going to make the Colour/Fill  transparent. Try setting to 1 instead.

If(Label18.Text="4",RGBA(0,125,153,1),RGBA(238,127,75,1)).

 

It should be a case of changing the label fill property, but reference ThisItem.[FieldName] rather than Label[X].Text

 

E.g. For the label where the text property is set to ThisItem.Tier

If(ThisItem.Tier = 1, Red, RGBA(0,0,0,0))

View solution in original post

Pwhite
Level: Powered On

Re: Conditional Formatting Gallery Fields

I have a question for you before I reply with an answer.  Are you looking to take existing rows of data in a table and display them in a Gallery with this color formatting?  Or... Are you looking to create a form used in a Gallery to collect Answers and have conditional formatting based on whatever your parameters?  Once I know that then I can be sure I reply with what your looking for.  I understand your frustration though as I have spend two years deep learning powerapps and finally feel great about accomplishing these type of things like you are speaking of and for me working with data in Gallery's for multiple different scenarios is awesome because I can create them so quickly now the way I am doing it with all the pre-built conditional formatting, font sizes, font styles, displaying different controls in each row of the Gallery based on what applies for that row, ect, ect.  I think I can give you a good solution to your goal maybe.  Or I am willing  to share and try for you.

KJH1138
Level: Powered On

Re: Conditional Formatting Gallery Fields

Thanks for the response - at this point I just want to display existing data from a linked ShatePoint List.  Down the road I may want to use this 'report' page as a jumping off point to an edit screen, but for now I'm just trying to display static data.

KJH1138
Level: Powered On

Re: Conditional Formatting Gallery Fields

Problem solved ! Thanks for spotting that - as usual it's the details that stynied me.  Much appreciated.   

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,171)