cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Englishweb
Level 8

change text colour on Button in Gallery using If

Hello

I'm trying to figure out the syntax to change a button text colour in a gallery item in the color properties using:

If(ThisItem),(DatePickerS1End.SelectedDate <=Today(),Red,Green)

The text property is ThisItem.Student1

I don't know how/where to reference ThisItem

Can anyone help?

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Englishweb
Level 8

Re: change text colour on Button in Gallery using If

There are other buttons on the Parent gallery which are working as expected:If(Value(S1Hrs)>=10,Red,White)

I'm trying to get each button text to change colour , using the item

 = If(DatePicker1.SelectedDate (Student1)<= Today(), Red,Green)

At the moment each button changes to the same colour, according to the gallery row selected

View solution in original post

5 REPLIES 5
Jcook
Level 8

Re: change text colour on Button in Gallery using If

Hello @Englishweb

Let me understand this a bit more, so you wan to have al the buttons in your gallery text red if the date that is selected in the date picker is Today, or some date in the past. But if the Date is tomorrow or farther than text is green?

 

Here is what I came up with:

 

PicMain.png

 

The Syntax I am using on the button Color = If(DatePicker2.SelectedDate <= Today(), Red,Green)

 

You do not need to use ThisItem to make this work.

 

Hope this helped!

 

--Josh

Englishweb
Level 8

Re: change text colour on Button in Gallery using If

Hello @Jcook That's exactly what I was aiming for, unfortunately, all the buttons on the Parent Gallery turn red! The date picker is on the child gallery (where the same syntax works perfectly). Its the parent gallery button text colour which is the problem.

Jcook
Level 8

Re: change text colour on Button in Gallery using If

What are the relationship between the 2 galleries. Could you share some more info or pictures?
Englishweb
Level 8

Re: change text colour on Button in Gallery using If

hello @Jcook The parent gallery ireferences the datasource and the child gallery is ParentGallery.Selected

Does this help?

Englishweb
Level 8

Re: change text colour on Button in Gallery using If

There are other buttons on the Parent gallery which are working as expected:If(Value(S1Hrs)>=10,Red,White)

I'm trying to get each button text to change colour , using the item

 = If(DatePicker1.SelectedDate (Student1)<= Today(), Red,Green)

At the moment each button changes to the same colour, according to the gallery row selected

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,554)