cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Multiple Filter Gallery (Project and Dates)

Hello friends,

 

I'm trying to build an document listing app for my departament, and i'm building a list to show all the files inside a folder in OneDrive to help us to know which of the files is the most recent to work on. I'm having a issue on how can i show only the most recent files in that folder who has the same name. The image below can show you better what i'm talking about.

 

Dúvida 2.jpg

 

So the filter function is already getting the files in the folder of the named project (Or Subestação in formula), so i'd like to know how can i expose just one "Excel1.xlsx" file with the most recent date (in this case 05/02/2021, date format = ''dd/MM/yyyy").

 

The dates of file creation is listed in one of the columns of the spreadsheet that is used as "database" of this app.

 

All help will be apreciated, thank you so much.

4 REPLIES 4
mdevaney
Super User
Super User

@Anonymous 

Here's a sample of the code you can use to get only the 1st item.

FirstN(
    Sort(
        Filter(Tabela2; Subestacao = LblAppName5.Text),
        DateColumnName,
        Descending
    ),
    1
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

Hey @mdevaney , thanks for the answer.

 

This worked good for selecting the most recent file, but now it just displaying the most recent file in all folder, the other files with different names were hidden and i need them in the list too. In this case i just have to guarantee that the gallery items are composed with the most recent file with the same name, each one of them.

As i example, if have a Excel1.xlsx file updated today and one updated tomorrow, the item on list should be the file updated tomorrow and also show the other files in folder like Excel2, 3 and so on. There's a solution for this situation? Thank you so much!!

mdevaney
Super User
Super User

I don't understand.  You said you wanted only the most recent file showing... and that's what we did here.  What do you require?

Anonymous
Not applicable

It's possible that i didn't explain it well, sorry about that, english is not my main language, but i'll try my best to let things clear.

 

So, everytime that a person put some file in my OneDrive selected folder a flow will run and put all the information about that file in a spreadsheet on excel online, a part of this is demonstrated below.

glawberc_1-1611699767054.png

 

I need to filter my gallery with two parameters, first by the column "Subestação", that will guarantee that all files displayed in my gallery belongs to the same project and second by the column "DatadeCriação" that will guarantee that the file displayed in gallery list is the most recent based on data inside the spreadsheet.

 

For example: All files in this spreadsheets belongs to project "Example 1" and this have some subfolders named with the lines in column "Revisão" and inside of this subfolders we'll have files like "Excel1.xlsx". The case is, i already have the item "Excel1.xlsx" in gallery and i'm looking to show now the most recent files that where updated in "15.01.2021" folder, in this case the new "Excel1.xlsx" who has the most recent date and also to display the new file "Excel5.xlsx" that was updated with her. With the formula you shared above it only displays the most recent file off all files, and i'm looking for one who can diferentiate files with the same name and get the most recent one based on the data of this spreadsheet.

Idk if was very clear, but i tried hard 😂
Tysm for the answers!

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,632)