web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display latest date su...
Power Apps
Unanswered

Display latest date submission of multiple categories based on selection in previous screen

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have a primary data source, datasourceA, which stores all submissions from many different users. datasourceA looks something like this:

 

BuildingRoomCleanDate
Building A100Daily6/23/2021
Building A101Daily6/23/2021
Building A100Weekly6/21/2021
Building A101Weekly6/22/2021

 

In one room (Room 100), there may be multiple different clean types done on different days (shown above as daily or weekly, datasourceA actually has about 6 clean types). 

 

What I need to do is take a distinct list of rooms from datasourceA and display them in Screen A. I want to be able to choose a room from that list, which will take me to Screen B. I want Screen B to display the most recent date of each different clean type (daily, weekly, etc.).

 

I tried doing the following: 

 

1. I collected the Date, Room, and Clean columns from datasourceA into listA using ClearCollect and GroupBy.

 

2. I used listA to get a distinct list (listB) based on the Room column so I could create a dropdown menu in Screen A that filtered by Room. The gallery (galleryA) in Screen A uses the result of the drop down menu. I added an icon to navigate to Screen B.

 

3. Screen B has Gallery B, which I would like to contain the most recent cleans that correspond to the selected room from Screen A. My issue (as you can probably see) is the only item stored in Gallery B is the distinct list of rooms in listB; the clean type and date are not stored in Gallery B. This makes it so I can't use ThisItem.Clean or ThisItem.Date in Gallery B.

 

How do I create this relationship? Is there a better way of doing this?

 

Thanks,

 

Nick

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Bumping this; still having trouble deciding what to do. I think I might try creating a nested collection for each room, containing each clean type, then displaying the dates as a table within the clean type collection (if this is even possible). Then I can use the First function on the drilled down nested collection.. No clue if this will work/how I can execute it, any better ideas?

  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    @Anonymous 

    say your collection name is colDatasourceA,

    gallery on ScreenA name is galleryA,

    gallery on ScreenB name is galleryB

     

     

    galleryA.Items = Distinct(colDatasourceA, Room)

     

    galleryA.OnSelect = 

    Clear(colDatasourceB);
    ForAll( Distinct(colDatasourceA, Clean) As ThisCleanType,
    Collect(colDatasourceB, LookUp(Sort(colDatasourceA, Date, Descending), Room = ThisItem.Result && Clean = ThisCleanType.Result))
    )

     

    galleryB.Items = colDatasourceB

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard