cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular 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
Super User
Super User

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
Super User
Super User

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

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (68,302)