web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create safety cross
Power Apps
Unanswered

Create safety cross

(1) ShareShare
ReportReport
Posted on by 212

Hello Community, can someone please help me, I want to display this security cross (see picture) in PowerApps.
It should be maximum of days / month, so if we have the month of June then it should have 30 days. Per day where no accident happened I want to click on it and it should be green, I also want a near accident in orange and accident in red. Can someone show me how to do it?

 

@BCBuizer @mmollet 

SAFETY CROSS.png
Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @Adinator,

     

    If the coloured squares in the screenshot are buttons then consider setting the Fill property of each one to a different variable (for example, locDay01Colour, locDay02Colour, ... locDay31Colour).

     

    Then for each button, add code on the OnSelect property to set the appropriate variable to the colour required.

     

    Another, more generic approach, would be to use a gallery (unless this is a gallery already) instead of individual buttons then the OnSelect property code may be able to be reused..


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • Adinator Profile Picture
    212 on at

    Hi @KeithAtherton , these are buttons, can you show me the codes that I can use.
    I did it like in the screenshot1.png

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Let's start with day 1 for now. Try the following:

     

    Add the following code to the screen OnVisible property:

    UpdateContext({locDay01Mode:"NoAccident"});

     

    Select the day 1 button and add the following code to the Fill property:

    Switch(locDay01Mode,
     "NoAccident", Color.Green,
     "NearAccident", Color.Orange,
     "Accident", Color.Red
    )

     

    Try changing the value of locDay01Mode to "NoAccident", "NearAccident", and "Accident" to see the button colour change.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard