cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jason_Hough
Resolver I
Resolver I

TemplateFilll in Gallery colours

Hi All, 

 

On my template Fill , I have this colde:

 

If(ThisItem.IsSelected, RGBA(242,242,242,1), White)

 

So when the item is selected , the colour is set to RGBA else its White. 

 

When you select an gallery item - it shows an Form. Within the form there is a series of questions and when the user is happy that all the questions are complete , they choose the date and then this form is complete. 

 

I need to know how I would change the colour of the gallery item when the date has been selected (OnSelect) and then update the colour of the gallery item (ThisItem) but also if this section is not done - still have this code working : 

 

If(ThisItem.IsSelected, RGBA(242,242,242,1), White)

 

So the items which have been done have be cornered off (with a different colour) so the user knows he/she doesnt have to go back to them again.

 

Hope this makes sense. thanks. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @Jason_Hough,

 

That could be achieved.

But it would require the Gallery item has a field to Mark the Date Status.

For example, in each record of the gallery, we have a field set to true or false (Boolean type).

Then the TemplateFill formula should be written in the following way:

If(ThisItem.IsSelected&&(DataColor=false||IsBlank(DataColor)), //This is used to check the Selected status,
RGBA(242,242,242,1), //Define the selected color,
If(DataColor=true, //Identify if the Mark has been updated,
RGBA(100,200,242,1), //Define the Color with Date selected
White) //white color if non-selected, and DataColor is false or blank
)

Then under the OnSelect property of the DatePicker, we need to update this FieldInGallery to true, formula should be:

Patch(GalleryDataSource,Gallery.selected,{DataColor:true})

Screenshots:

91.PNG

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-micsh-msft
Community Support
Community Support

Hi @Jason_Hough,

 

That could be achieved.

But it would require the Gallery item has a field to Mark the Date Status.

For example, in each record of the gallery, we have a field set to true or false (Boolean type).

Then the TemplateFill formula should be written in the following way:

If(ThisItem.IsSelected&&(DataColor=false||IsBlank(DataColor)), //This is used to check the Selected status,
RGBA(242,242,242,1), //Define the selected color,
If(DataColor=true, //Identify if the Mark has been updated,
RGBA(100,200,242,1), //Define the Color with Date selected
White) //white color if non-selected, and DataColor is false or blank
)

Then under the OnSelect property of the DatePicker, we need to update this FieldInGallery to true, formula should be:

Patch(GalleryDataSource,Gallery.selected,{DataColor:true})

Screenshots:

91.PNG

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @Jason_Hough,

 

Do you need any further help on this?

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, 

 

I have the same issue, and am unable to get your solution to work (probably something I am doing wrong as I am new to Power Apps). Could you help?

 

I want to do the same but with my SaveButton, so if its selected and therefore the form is saved/changed, then I would like to change the row/item in my Gallery to a certain colour, so that the end user knows that they have updated the form (but only within that instance of using it (for a meeting). 

I want to keep them blue if selected, but changed to Green if saved and modified, otherwise White.

 

In the TemplateFill of the Gallery this is what I have so far:

If(ThisItem.IsSelected&&(SaveButton.Selected = false)),RGBA(136, 160, 209, 1), If(SaveButton.IsSelected,Green,White))

 

In the SaveButton, this is what I have:

SubmitForm(Form1)&& ViewForm(Form1)&&Patch('DateSource',Gallery1.Selected,SaveButton.IsSelected)

 

Any help would be very much appreciated!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,336)