cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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.

Highlighted

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

Highlighted

Hello, a little bit of additional help?

 

Thanks

Highlighted

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?

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (10,223)