0

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

5
  • Are Marketing Spec 1 and Marketing Spec 2 Document [Title], [Name] or a [Document Type] in SharePoint Document Library? Commented Oct 29, 2020 at 1:18
  • No, Those were just examples. I can adjust the form so that the options can be the name of the file. Commented Oct 29, 2020 at 1:51
  • I couldn't finish it yesterday.. however, planning to finish it today and post my response Commented Oct 29, 2020 at 12:08
  • That is great. I have been trying to piece together processes from others I have found online and just can't seem to get it to work. I really appreciate it. Commented Oct 29, 2020 at 13:36
  • It's a lengthy post, but I've tested. Let me know if you have any questions Commented Oct 29, 2020 at 16:26

1 Answer 1

0

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]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.