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

806 views Asked by At

I have the following list and document library in the same SharePoint site:

SharePoint List (Policy Inventory):

enter image description here

SharePoint Document Library (Policy-Working-Documents): Sharepoint Document Library

My current flow filters for items in the list with a review date that is +120 days from today, then it gets the files from the document library sub-folder named Test-Folder.

I am really struggling with the following:

  1. Filtering the Get Files output so as to keep only the files with a Name that is also contained in the output of Get Items?

  2. Send an Outlook email that contains the documents from #1 as an attachment or link. The body of the email should include the Document Name and Review Date which are provided in the Policy Inventory list.

My current flow:

enter image description here

1

There are 1 answers

4
kshkarin On

Here's an example using the Get Files, Create HTML Table and Send an Email to achieve what was asked in the title:

First the Get Files and Create HTML Table -> the value in From is the collection received from the Get Files step enter image description here

Then the final Send an Email step uses the output as the Body from the Create HTML Table step: enter image description here

EDIT: To filter the OData Get Files step use the following steps - Get Items from the list with file name filters enter image description here

Then Initialize String Variable for the OData filter, append to that variable the following: concat('or FileLeafRef eq', '''', items('Apply_to_each_3')?['Title'], '''') enter image description here

That'll create the OData filter and use that in the Get Files step Advanced and Filter Query value.