cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kepcla
Helper II
Helper II

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

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

 

 

17 REPLIES 17

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...

 

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 

 

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.

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.

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    

Kenneth your a genious!

It works finnaly!

Thanks total!

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

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

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,899)