Skip to content
Matthew Devaney

No Ads, No Fluff, Just Power Apps Stuff

7 Power Apps Gallery Conditional Formatting Examples

7 Power Apps Gallery Conditional Formatting Examples

With conditional formatting, we can use colors and symbols to explain the meaning of values in a Power Apps gallery. For example, we can make positive values the color green to show success. And make negative values the color red to signal a failure. Any type of formatting is possible once you learn to use IF statements. In this article I will show you how to perform conditional formatting in a Power Apps gallery.

Download Free PDF   😺



Table Of Contents:

 Introduction: The Employee Training App
 Setup The SharePoint List
 Create A New App With A Gallery

 Conditional Formatting With Text Criteria Examples
 •  Formatting A Single Text Value
 •  Formatting Multiple Text Values
 
 Conditional Filtering With Number Criteria Examples
 •  Formatting With A Single Number Criteria
 •  Formatting With Two Number Criteria
 •  Formatting With Many Number Criteria

 Conditional Filtering With Gallery Row Colors

 Conditional Filtering With Emojis
 •  Formatting With Checks And Xs Emojis
 •  Formatting With Happy And Sad Face Emojis




Introduction: The Employee Training App

Workers at a construction company use the Employee Training App to take online courses and view their progress. The app uses conditional formatting to make it easy to identify a passing score vs. a failing score.




Setup The SharePoint List

Create a SharePoint list named Employee Training with the following columns:

  • Title – default column
  • Employee – person type
  • Score – number type
  • Status – choices type (Not-Started, In-Progress, Passed, Failed)



Add these items to the SharePoint list:

TitleEmployeeScoreStatus
Safety TrainingMatthew Devaney70Passed
I/T Security ExamMatthew Devaney95Passed
Ethics & Fraud TrainingMatthew Devaney35Failed
Job Skills AssessmentMatthew Devaney80Passed
Diversity TrainingMatthew DevaneyIn-Progress
Forklift CertificationMatthew DevaneyNot Started

Open Power Apps Studio and create a new phone app from blank. Insert a blue rectangle shape at the top of the screen and place a label with the words “Employee Training” over top of it.



Add a connection to the Employee Training SharePoint list. Then insert a gallery and select the Employee Training SharePoint list as the datasource.



Place two new labels and a button into the gallery to show the Title, Score and the Status of each Employee Training record.



Use this code in the Text property of the controls

ThisItem.Title  //lbl_Title
ThisItem.Score  // lbl_Score
ThisItem.Status.Value  //lbl_Status




Conditional Formatting With Text Criteria Examples

The following examples show how to perform conditional formatting using text values in the criteria.

Formatting A Single Text Value

Give the status button a green fill when Status equals “Passed”



Use this code in the Fill property of the btn_Status.

If(ThisItem.Status.Value="Passed", Green, RGBA(56, 96, 178, 1))


Formatting Multiple Text Values

Make the status button green when Status equals Passed, red when Status equals Failed, yellow when Status equals In-Progress and gray when Status equals Not Started.



Use this code in the Fill property of the btn_Status.

If(
    ThisItem.Status.Value="Passed",
    Green,
    ThisItem.Status.Value="Failed",
    DarkRed,
    ThisItem.Status.Value="In-Progress",
    GoldenRod,
    ThisItem.Status.Value="Not Started",
    Gray
)




Conditional Filtering With Number Criteria Examples

The following examples show how to perform conditional formatting using number values as the criteria.



Formatting With A Single Number Criteria

Color any training scores less than 50 red.



Use this code in the Color property of lbl_Scores.

If(ThisItem.Score < 50, Red, Black)


Formatting With Two Number Criteria

Show any training scores greater than or equal to 50 as green and any numbers less than 50 red.



Use this code in the Color property of lbl_Score.

If(ThisItem.Score >= 50, Green, Red)


Formatting With Many Number Criteria

Make the score text green when Status is greater than or equal to 80, yellow when the Score is equal or greater than 50 or red when the Score is less than 50.



Use this code in the Color property of lbl_Score.

If(
    ThisItem.Score >= 80,
    Green, ThisItem.Score >= 50,
    GoldenRod, Red
)

Highlight a gallery row with the color yellow when a Score is less than 50.



Use this code in the TemplateFill property of the Gallery.

If(ThisItem.Status.Value="Failed", PaleGoldenRod, Transparent)




Conditional Filtering With Emojis

The following examples show how to do conditional formatting using Emojis.



Formatting With Checks And Xs Emojis

When a Score is greater than or equal to 50 show a ✅ emoji and display a ❌ when a Score is less than 50.



Use this code in the Text property of lbl_Score. To access the emoji menu in Windows press the hotkey combination [Windows Key] [Period].

If(
    ThisItem.Status.Value = "Passed",
    "✅",
    ThisItem.Status.Value = "Failed",
    "❌"
)


Formatting With Happy And Sad Face Emojis

Display a 😊 emoji when a Score is greater than or equal to 50 and show a 😢 when a Score is less than 50.



Use this code in the Text property of lbl_Score. To access the emoji menu in Windows press the hotkey combination [Windows Key] [Period].

If(
    ThisItem.Status.Value = "Passed",
    "😊",
    ThisItem.Status.Value = "Failed",
    "😢"
)





Questions?

If you have any questions about 7 Power Apps Gallery Conditional Formatting Examples please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

6 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Richard
Richard
3 months ago

Hi Matthew, great post !!!

I just have a question. It is possible to filter the gallery with a comboBox “by color”, the green ones, the red ones, etc ???

I know that the obvious answer is, filter by “status column” but, it is possible filter by color of the button ??

wpDiscuz

聚圣源欧姓男孩起名大全复仇者联盟1下载适合女孩起名属火的字无心法师第三季免费用八字取名起名大全江户川乱步林可以起什么名字高端设计室起名如何网赚2021年出生的男孩起什么名字好西电退学33失联博士微信名怎么起好听成吉思汗电视剧win101709宿命传说2攻略大米的商标起个名字2020郝姓女孩起名八字起名测试字笔画笔顺笔划8画的字起名无限影视开贸易公司起名字空间留言符号萨博橱柜店铺起名酥甘姓男宝宝起名起名称测试打分女孩起名儿姓桂女宝宝起名tvs2以海字起名淀粉肠小王子日销售额涨超10倍罗斯否认插足凯特王妃婚姻让美丽中国“从细节出发”清明节放假3天调休1天男孩疑遭霸凌 家长讨说法被踢出群国产伟哥去年销售近13亿网友建议重庆地铁不准乘客携带菜筐雅江山火三名扑火人员牺牲系谣言代拍被何赛飞拿着魔杖追着打月嫂回应掌掴婴儿是在赶虫子山西高速一大巴发生事故 已致13死高中生被打伤下体休学 邯郸通报李梦为奥运任务婉拒WNBA邀请19岁小伙救下5人后溺亡 多方发声王树国3次鞠躬告别西交大师生单亲妈妈陷入热恋 14岁儿子报警315晚会后胖东来又人满为患了倪萍分享减重40斤方法王楚钦登顶三项第一今日春分两大学生合买彩票中奖一人不认账张家界的山上“长”满了韩国人?周杰伦一审败诉网易房客欠租失踪 房东直发愁男子持台球杆殴打2名女店员被抓男子被猫抓伤后确诊“猫抓病”“重生之我在北大当嫡校长”槽头肉企业被曝光前生意红火男孩8年未见母亲被告知被遗忘恒大被罚41.75亿到底怎么缴网友洛杉矶偶遇贾玲杨倩无缘巴黎奥运张立群任西安交通大学校长黑马情侣提车了西双版纳热带植物园回应蜉蝣大爆发妈妈回应孩子在校撞护栏坠楼考生莫言也上北大硕士复试名单了韩国首次吊销离岗医生执照奥巴马现身唐宁街 黑色着装引猜测沈阳一轿车冲入人行道致3死2伤阿根廷将发行1万与2万面值的纸币外国人感慨凌晨的中国很安全男子被流浪猫绊倒 投喂者赔24万手机成瘾是影响睡眠质量重要因素春分“立蛋”成功率更高?胖东来员工每周单休无小长假“开封王婆”爆火:促成四五十对专家建议不必谈骨泥色变浙江一高校内汽车冲撞行人 多人受伤许家印被限制高消费

聚圣源 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化