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

Filter a gallery by specific columns via an OnSelect property of label from another screen?

Hey PowerApps experts,

 

I've got a navigation and filter problem that I can't seem to wrap my head around.

I have a screen which reads the counts of tasks which are complete vs incomplete (which are defined by whether various columns in a SP list are or are not blank.) Each record is a "data trial" where I have to keep track if various steps were completed, so it's basically like a giant checklist.

 

task count screen.png

 

So looking at the selected label on this screenshot here, I have a task where 38 records haven't had that step completed. I need a quick way to answer the question "what are the 38 records where this step is incomplete?"

 

What I want to do is click on any "incomplete task" number and have it navigate to a details screen that filters a gallery of my SP list by the same logic as in the selected number's Item property (the blue highlighted text).

 

I have tried multiple ways to make this happen, but I'm having trouble understanding how best to assign the filter criteria variable to each number's OnSelect property, and pass it to the details screen in such a way that the Gallery's Item property can read it properly.

 

How is this best accomplished? Set a variable? Update Context? Do the filtering on this screen or the target screen? Any help would be greatly appreciated, thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Sephiel ,

Could you please share a bit more about your scenario?

Do you want to click  any "incomplete task" number to navigate to the Detail screen, then display the details for corresponding filtered records within a Gallery?

 

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the "incomplete task" number Label to following:

ClearCollect(
             IncompleteTasksCollection,
Filter(
'Master Trial File Tracking',
Year = DropdownYear.Selected.ColunStart,
!IsBlank(KeyLearningsReceivedDate),
IsBlank(UnabridgedSumCompDate),
Group=""PDFT,
TrackingStatus.Value = DropdownTrialStatus.Selected.Value
) );
Navigate(DetailScreen)

Within your DetailScreen, add a Gallery control, set the Items property to following:

IncompleteTasksCollection

then within the Gallery, you could add some Label controls, then set the Text property to following:

ThisItem.ColumnName1
ThisItem.ColumnName2
ThisItem.ColumnName3

....

to reference the column value from your SP list data source.

 

Best regards,

Community Support Team _ Kris Dai
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
Pstork1
Dual Super User III
Dual Super User III

I think you are overthinking the filter here.  If you are going to click on a specific task then a Lookup value to that task is all you need to send to the detail screen.  It doesn't matter whether the record is using the same filter on the detail screen since it will only show details for that specific record, which was already part of the filtered view.  Or am I missing something in your description?



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
v-xida-msft
Community Support
Community Support

Hi @Sephiel ,

Could you please share a bit more about your scenario?

Do you want to click  any "incomplete task" number to navigate to the Detail screen, then display the details for corresponding filtered records within a Gallery?

 

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the "incomplete task" number Label to following:

ClearCollect(
             IncompleteTasksCollection,
Filter(
'Master Trial File Tracking',
Year = DropdownYear.Selected.ColunStart,
!IsBlank(KeyLearningsReceivedDate),
IsBlank(UnabridgedSumCompDate),
Group=""PDFT,
TrackingStatus.Value = DropdownTrialStatus.Selected.Value
) );
Navigate(DetailScreen)

Within your DetailScreen, add a Gallery control, set the Items property to following:

IncompleteTasksCollection

then within the Gallery, you could add some Label controls, then set the Text property to following:

ThisItem.ColumnName1
ThisItem.ColumnName2
ThisItem.ColumnName3

....

to reference the column value from your SP list data source.

 

Best regards,

Community Support Team _ Kris Dai
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

Sephiel
Helper II
Helper II

@Pstork1 Yes I am pretty good at overthinking things! 🙂 Usually it's because I'm missing a very easy command that I just wasn't aware of....which is the case again. I hadn't properly figured out how to use collections for this case! I knew I could somehow assign a variable of sorts that could change my gallery results, but I was stuck on how to do that with an outside data source. I was thinking I'd have to pass the database information as is, somehow, but now I smack my forehead thinking collecting it into a local table makes perfect sense. Then the table collection changes based on which number label I click on...Thanks for the response, when I get stuck, even a little nudge in the right thinking helps quite a bit!

 

@v-xida-msft You hit it spot on! I had just figured this out a couple hours before your response, but yes, what I'd missed is how to collect the SP list info into something I could change based on which label I clicked. Your code is pretty much exactly what I used! Thanks so much for the help!

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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
Top Kudoed Authors
Users online (20,146)