Question

I created a form that collects the email address of the users making the request and the email address where they would like to send the email. The third part of the form lists documents that are available to select. I would like to be able to send more than one document in an email if possible. Thanks in advance for any help or direction.

The documents are PDF files in a SharePoint.

enter image description here

I have setup a flow to get the responses and list the folder contents of the SharePoint folder, but I'm not sure what to do match up the selections from the form to the documents to email.

enter image description here

No correct solution

OTHER TIPS

Here's the solution that I can come up with:

  1. SharePoint Document Library

    Added a custom choice column, [SpecType], to match the user selection in the MS Forms. For example: Marketing Spec1, Marketing Spec 2, Sales Spec 1, Sales Spec2 etc.

  2. MS FORM

    Same as mentioned in the requirements, that is, user can choose one or more specs.

Screenshots showing the flow with additional details and explanation

enter image description here

Expression -1

The goal is to capture the "Select Documents" options from the MS Form Response and put them into an array to retrieve specs/docs from the SP library. Having analyzed the output of [Select Documents], which is an MS Form field, found that it's structure in the Flow output looks like ["Marketing Spec 1","Marketing Spec 2"] , so need to replace few chars and split the string to convert into an array and capture it in a [Compose] action. Please note that outputs('Get_response_details')?['body/rfa0aef609e874b14a40f4f1674a08044'] needs to be selected from the dynamic content as the GUID value might be different in your case.

split(replace(replace(replace(string(outputs('Get_response_details')?['body/rfa0aef609e874b14a40f4f1674a08044']), '[', ''), ']',''), '"',''), ',')

Store the output from [Compose] in [ArraySpec]

enter image description here

Detail 1

enter image description here

Detail 1-1

Within the [Apply to each], need to retrieve file content based on the [Identifier] property and store into array variables to used in sending emails

enter image description here

Detail 2

Could not find an easy way to zip the attachments, so use multiple send email constructs using [switch control]. This is something to be enhanced.

enter image description here

Expression - 2

To send the email, get the file content and file name from the array variables

variables('varDocumentName')?[0]

variables('varDocumentContent')?[0]

Expression - 3

when two docs/specs are requested.

variables('varDocumentName')?[0]

variables('varDocumentContent')?[0]

variables('varDocumentName')?[1]

variables('varDocumentContent')?[1]
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top