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

Include link in an email to a document(s) in a SharePoint library

Hi everyone,

 

I have a SharePoint site that includes the following: 

 

  • A SharePoint list named Policy Inventory
  • A SharePoint document library named Policy-Working-Documents with a sub-folder named Test-Folder with the documents needed for this flow.

My current daily recurring flow is supposed to accomplish the following:

 

1. Use Get Items to search the Date column in the list for dates that are 120 days out from the current date. 

2. Uses Get Files and Filter Array to get the document names within the document library sub-folder.

3. Use Condition to see if the document names within the document library sub-folder contain the document name in the list.

4. If the document name in the document library is contained in the list document name, send an email that contains:

       a. A link to the document in the document library for the receiver to click and open. 

 

My current flow is throwing the following error:

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@{outputs('Get_files_(properties_only)')?['body/value']}@{body('Filter_array')}' is of type 'String'. The result must be a valid array.

 

flow_3.png

 

Screenshots of my current flow:

flow_1.png

 

flow_2.png

 

Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
Diksha
Resolver IV
Resolver IV

Hi @flyingspoon ,

 

Refer below flow having actions as below - 

1. Get Items : Get item from Policy inventory list with Filter Query - 

ReviewDate eq 'addDays(utcNow(),120,'M/d/yyyy')'

 where ReviewDate is the internal name of Review Date column.

 

2. Get files (properties only) : Get files from Policy-Working-Documents library with Filter Query -

FileRef eq '@{items('Apply_to_each')?['DocumentName']}'

which will filter File name with the Document Name column value from list. 

3. You can then use the 'Link to item' property of Get Files output in Send an email action .
flow.png

If this answered your question, please mark this question as answered and if you liked my response, please consider giving it a thumbs up .
Thank You !!!

View solution in original post

2 REPLIES 2
Diksha
Resolver IV
Resolver IV

Hi @flyingspoon ,

 

Refer below flow having actions as below - 

1. Get Items : Get item from Policy inventory list with Filter Query - 

ReviewDate eq 'addDays(utcNow(),120,'M/d/yyyy')'

 where ReviewDate is the internal name of Review Date column.

 

2. Get files (properties only) : Get files from Policy-Working-Documents library with Filter Query -

FileRef eq '@{items('Apply_to_each')?['DocumentName']}'

which will filter File name with the Document Name column value from list. 

3. You can then use the 'Link to item' property of Get Files output in Send an email action .
flow.png

If this answered your question, please mark this question as answered and if you liked my response, please consider giving it a thumbs up .
Thank You !!!

View solution in original post

v-alzhan-msft
Community Support
Community Support

Hi @flyingspoon ,

 

Have your problem been solved by @Diksha  's solution?

If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,221)