cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bpg950
Level: Powered On

Highlight gallery item based on another SharePoint list item

I am stumped.

 

I know it is possible but I can't get it to work.

 

I have two Sharepoint Lists DataCollection (Contains the list of all tasks to be completed) and CompletedTasks (SP list of tasks that have been recorded as complete for that trainee)

 

I want my gallery in Powerapps (Gallery is all items in DataCollection) to show when the TaskID is in CompletedTasks to background fill in another color.

1 ACCEPTED SOLUTION

Accepted Solutions
Eelman
Level 10

Re: Highlight gallery item based on another SharePoint list item

@bpg950 

Sounds like your users login to view their own tasks, is this correct?

 

When using the User() function options it's always best to put this in a variable in the App.OnStart because it doesn't always work in all places throughout the app. Something like this in the OnStart

 

Set( vUserFullname, User().FullName)

 

then,

 

Gallery1.TemplateFill = If ( ThisItem.TaskID in Filter ( CompletedTasks, Trainee = vUserFullname).TaskID, Color1, Color2)

 

If your SP column Trainee is a Lookup/Choice/Person column then replace Trainee with Trainee.FullName or whatever the intelligence allows.

View solution in original post

6 REPLIES 6
Eelman
Level 10

Re: Highlight gallery item based on another SharePoint list item

@bpg950 

Typically, you use the TemplateFill property to do this. I could give you some direction on how to use it if you could provide some info about what you have tried, gallery.items, etc

Super User
Super User

Re: Highlight gallery item based on another SharePoint list item

Say if the unique ID of each record is in a column called ID.

You could set the TemplateFill property of the gallery to:

If(IsBlank(LookUp(CompletedTasks, ID = ThisItem.ID, Color1, Color2)

Where Color2 is the color you want if the record is in the completed list.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
bpg950
Level: Powered On

Re: Highlight gallery item based on another SharePoint list item

I think you are pointing me in the right direction, but I left out the part where I first need to sort the completed task list by user - 

 

I'm assuming I have to add another condition like:

If(User().Fullname = CompletedTasks.Trainee.Fullname ....

 

Again I can't get it to work, but I know we are getting close.

 

Eelman
Level 10

Re: Highlight gallery item based on another SharePoint list item

@bpg950 

Sounds like your users login to view their own tasks, is this correct?

 

When using the User() function options it's always best to put this in a variable in the App.OnStart because it doesn't always work in all places throughout the app. Something like this in the OnStart

 

Set( vUserFullname, User().FullName)

 

then,

 

Gallery1.TemplateFill = If ( ThisItem.TaskID in Filter ( CompletedTasks, Trainee = vUserFullname).TaskID, Color1, Color2)

 

If your SP column Trainee is a Lookup/Choice/Person column then replace Trainee with Trainee.FullName or whatever the intelligence allows.

View solution in original post

Super User
Super User

Re: Highlight gallery item based on another SharePoint list item

Are you saying you need to get the gallery of DataCollection sorted? The logic to search for whether a particular record is in the other gallery should still be the same. What is your Items property of the gallery of DataCollection and what is your current expression for trying to highlight a row (TemplateFill)?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
bpg950
Level: Powered On

Re: Highlight gallery item based on another SharePoint list item

Thank you Thank you!

 

This worked perfectly!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,908)