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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Coloring my calendar e...
Power Apps
Unanswered

Coloring my calendar events

(0) ShareShare
ReportReport
Posted on by 8

Good day everybody!

I made a calendar from scratch. I'm using nested gallerys to make it work. It works properly, but people would like me to make it when they adding events to a calendar , every events should have its on color. I attached an image. I would like to make it so these "Tests" appear with different colors. And some as other events.

BoruzsRobin_0-1625644763028.png

 

If you need any additional information to be able to help please let me know.

 

Best regards,

Robin

 

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @BoruzsRobin ,

    Using Rand() and Round() functions it can be a way to achive your expectations.

    In Fill property of the Label control use something like:

    RGBA(Round(Rand()*255,0), Round(Rand()*255,0),Round(Rand()*255,0),1)

    In this way all events in calendar will have a randomize color. 

     

    Hope it helps ! 

  • BoruzsRobin Profile Picture
    8 on at

    Hey, its close, I just have an other problem with it this way.

    I would like to give one event the same color, so both of test 1 should be blue.

    And for some reason it does not fill out the whole area. //Edit: I worked this out, only need something for the other problem

    BoruzsRobin_0-1625731517568.png

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @BoruzsRobin ,

    I use a formula based on the last three char of the meeting name. But you have to set a local collection before that. 

    In OnStart() property of the app use:

     

    ForAll(
     Sequence(26),
     Collect(alphabetCode,
     {ID:Value*2,Char:Char(Value+64)},
     {ID:Value*2+1,Char:Char(Value+96)}
     )
    )

     

     and in your Fill property of the label to:

     

    RGBA(
     Round(LookUp(alphabetCode,Right(Self.Text,1)=Char,ID)*4,0),
     Round(LookUp(alphabetCode,Mid(Self.Text,Len(Self.Text)-1,1)=Char,ID)*4,0),
     Round(LookUp(alphabetCode,Mid(Self.Text,Len(Self.Text)-2,1)=Char,ID)*4,0), 
     1
    )

     

    It's just a silly thought 😊 !

     

    Hope it helps ! 

  • BoruzsRobin Profile Picture
    8 on at

    Yes its almost OK now! 
    How would you change this code so it takes the first three latter not the last three?
    Because its seems its working just all of my title last 3 alphabet are the same, so if I could use the first three that would be very good.

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @BoruzsRobin ,

    RGBA(
     Round(LookUp(alphabetCode,Left(Self.Text,1)=Char,ID)*4,0),
     Round(LookUp(alphabetCode,Mid(Self.Text,2,1)=Char,ID)*4,0),
     Round(LookUp(alphabetCode,Mid(Self.Text,3,1)=Char,ID)*4,0), 
     1
    )

     

    I prefer the last 3 char because the probability to be different is higher than the first 3 char ( in your example meeeting Test1 and meeting Test2 will have the same color if you use the first 3 char). 

    I can try different approach on this matter.

     

  • BoruzsRobin Profile Picture
    8 on at

    Yes you are right but that was just for testing purposes. 
    Other than that in the title I'm using 7 different names which are different from each other so now its working properly.

    Thank you for helping , I appreciate it very much!

  • Evan1621 Profile Picture
    9 on at

    I have used your formula, but all entries in  the title Is black. Any idea? 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard