cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marvalar
Frequent Visitor

Select file in sharepoint folder

Hello,

Here is the scenario.

I have

  • an excel file that contains a list with document numbers
  • a sharepoint folder containing several documents

I want to create a link to a file in the sharepoint folder. The document number is part of the filename, but I have several files including the same document number. I want to select the one with the shortest filename.

 

What I did so far:

  1. With a Sharepoint list folder, I'm getting a list of all the files in the folder
  2. With a Filter Array I'm getting an array that contains all the files that include the target document number

 

The question is, how can I select the item from this array that has the smallest file name?

 

Thanks for your help!

 

5 REPLIES 5
v-litu-msft
Community Support
Community Support

Hi @marvalar,

 

You can select these file IDs into the Excel file instead of document numbers, the ID is unique and you could not worry about the same document name.

After you store these IDs into the Excel file, when you want to get these files or create a file, the ID could be used directly:

Annotation 2019-12-23 111529.png

 

Annotation 2019-12-23 111555.png

 

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

Thanks!

 

I already have the excel file with the doc numbers and we're talking about 100s of files, so I'm trying to avoid the hassle of doing it that way.

Thanks for the help

 

Cheers

Hello, a little bit of additional help?

 

Thanks

Hi @v-litu-msft 

 

I tried to follow your advice and got the files ID to the excel document. However, when using the "Get File Properties", I cannot refer to the corresponding excel column table as a dynamic content

 

Capture.PNG

 

Any workaround?

Hi @marvalar,

 

Sorry for late, because the output of the list tasks is an array, so you should add the Apply to each action to get each member of the task, then use the expression item()?['columnName'] to get the ID. Please refer to the following shows:

 

Annotation 2020-01-06 175508.png

 

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

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,651)