Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Changing color of the circle according to the value of the column in a Collection

(0) ShareShare
ReportReport
Posted on by

Hi All!

When I try to evaluate a column condition of a collection to change the color of a circle, it doesn't work ...

Any idea how to refer to the collection?

Image.jpg

 

 

Thanks in advance

 

Regards

S

 

 

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    The problem is format & region , switching to US fixed ALL!

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Kenneth,

    It works fine on my PC, but not in the cell phone.

    The circle of events should be here? How would you do you it? 

     

    Initial.jpg

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Kenneth your a genious!

    It works finnaly!

    Thanks total!

  • KennethNicasens Profile Picture
    275 on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Hi Kepcla,

     

    Just had a quick look at your collection data and your data notation is different than mine ( I'm from Belgium).

     

    So you will need to change to order of the Concatenate so that the format will be the same as in your collection.           

    Can you try this?     

     

    Hopefully this will solve your problem    

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Hi Kenneth,

    Excuse me for my lack of knowledge!

    Your code Is not working as expected. Maybe I´m doing something wrong, I only changed the source and colDate variable ....

    See the image.

    calendar.jpg

    Maybe using  a Gallery as reference, but not luck, it says "Expected ColorValue"...

     

    ForAll(Gallery1.AllItems,
    If(Title1.Text="Work",RGBA (138,43,226,1),RGBA (0,255,255,1)))

     

     

    Thanks a lot for your help anyway.

  • Verified answer
    KennethNicasens Profile Picture
    275 on at
    Re: Changing color of the circle according to the value of the column in a Collection

    @Kepcla 

     

    You could solve this by doing the following:

    In your collection you have the date. Based on this date you can do a lookup, problem is that you need to concatenate the date yourself.

    Switch(
     LookUp(
     colEvents,
     Concatenate(
     Text(
     Day(
     DateAdd(
     _firstDayInView,
     ThisItem.Value,
     Days
     )
     )
     ),
     "/",
     Text(Month(_firstDayOfMonth)),
     "/",
     Text(Year(_firstDayOfMonth))
     ) = Text(colDate)
     ).Item1,
     "Vacation",
     RGBA(56,96,178,0.2),
     "Work",
     RGBA(56,96,178,0.5 ),
     "Weekend",
     RGBA(56,96,178, 1),
    RGBA(56,96,178,0.6 )
    )

     
    I would also do a switch instead of an If, this way you make it more Future proof.

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    This code paints all the days in Red:    LookUp(DaysFinal,Item1="Vacations",Red)


    if there is an item with another value (eg: "work") , it does not paint it of another color...

  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    I think it´s little more complicated, it´s a circle in a calendar.

    The circle is visible according to the date column in the collection, (DateAdd(_firstDayInView,ThisItem.Value,Days) in DaysFinal.StartDate1) This code works OK..

    But I need to paint with a color X the circle according to the item, and that is the problem...

     

  • KennethNicasens Profile Picture
    275 on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Can you give a bit more context of the use of this functionality?

    You can create a gallery with each item and color the circle in for each record.
    Or do you want to check if there is 1 vacation within the list? Then you can use the following formula: If(Empty(Filter(colName, item1 = "vacation")),RGBA(),RGBA())
  • Kepcla Profile Picture
    on at
    Re: Changing color of the circle according to the value of the column in a Collection

    Sorry clumsiness!!😥

    Is not working...

    First function just evaluate the 1st record...

    I tried LookUp, Filter, ForAll, and not luck...

    My brain is hanging upside down😖

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard