.st0{fill:#FFFFFF;}

Stress-free method to add email to online MS forms and send an automated thank you email with a free tutorial attachment. 

 September 22, 2020

By  Christopher Bird

Enticing visitors to your website is a significant challenge. To tempt visitors to engage with your site and complete a form is a much greater task. To win visitors over you must provide strong benefits to do so. 

This article follows on from the previous article (Powerful Website Forms Using Microsoft Forms, Lists and Power Automate). In this article you will learn how to add a name and email text input to a form. I will show you how to amend your 'MS Power Automate Flow' to capture name and email. 

Then forward the data to SharePoint Online list and add another Power Automate to send an email. 

Microsoft Form add ‘Name’ and ‘Email’ input

Setup Time: 10 minutes 

Setup Overview: These setup instructions walk through the steps required. To add a ‘Microsoft Form',Name’ and ‘Email’ question. The lab exercise for PAF365: Power Automate Bootcamp

The first step is to open your ‘Form.’

Click the question above location you want to add ‘Name.’

Amend MS Form

Click the ‘+ Add new’ button.

You should see the below image. Click ‘Text.’

Add text question

Type what you wish for example ‘Your first name’ or ‘Full name.’

Add Name First

Click the ‘+ Add new’ button.

You should see the below image. Click ‘Text.’

Add text question

Type what you wish for example ‘Add your email address to download a free tutorial’ for question. For subtitle 'Powerful Website Forms Using Microsoft Forms, Lists and Power Automate.'

Email address question

Return to your form embed webpage. You need to generate test data. Answer your form questions. Then return to your ‘MS Form’ app.

Click the ‘Response’ (1) tab then click ‘Open in Excel’ (2) to download the workbook.

Download Form Excel workbook

Open ‘Excel’ download. You should see your newly added data inputs.

Form Submission Data

Your next step is to create a SharePoint list. Open Microsoft lists and click ‘+ New List.’

SharePoint Online List

In the ‘Create List’ pop up click ‘From Excel.’

SPO list wizard

Click the ‘Upload file’ button and navigate to where you stored your Excel Workbook and click next.

Excel workbook Upload

Complete the next pop-up. Name the list, give your list a description, select an icon colour and icon and specify where the list is to be created and stored. In most cases the default ‘My lists’ and click create.

Name list

All being well you should see something like the below image.

List for SPO

Note: Your list may have fewer entries. This list is required to build a Power Automate Flow.

If you are experiencing any challenges with the above setup, please read the previous article. ‘Powerful Website Forms Using Microsoft Forms, Lists and Power Automate some steps above assume you have read and implemented the previous blog post.

Congratulations.

Build a Flow

Setup Time: 30 minutes

Setup Overview: These setup instructions walk through the steps required. Using a SharePoint Online List to develop a Flow to send a thank you email for submitting an online form with attachment. The lab exercise for PAF365: Power Automate Bootcamp

Now you have a SharePoint Online list click the Automate menu option and select ‘Create a flow.’

From list build a Flow

From the popup choose ‘Send a customised email when a new SharePoint list item is added.’

Build a Flow

Power Automate opens. If you do not see green ticks indicating, you have granted permissions to services. You need to grant permissions by clicking the sign in links see below. Next click Create Flow.

Wizard to build a flow

A new window opens. Click ‘Edit.’

Flow edit

The next step window opens.

Edit Power Automate template

The above ‘Flow’ will grab new visitor form list submission data and with a few amends create a thank you email. The 'Flow' email will attach a OneDrive tutorial file. Then attach itself to the email before sending the email to the submitter of the completed form.

First, we need to step back a bit. We need to edit the ‘Flow’ you created in the first article. Remember you added two new questions. ‘Name’ and ‘Email.’  

Open a second browser tab and open ‘Power Automate’ and select ‘My Flows’.

Select the ‘Flow’ you previously configured for the first article.

Within ‘Apply to each’ click to expand the ‘Create item.’

Hopefully, you should see the below. Add ‘Name’ and ‘Email’ dynamic content.

Add dynamic content
Power Automate Expression

Note:First Name’ at the bottom you need not bother adding dynamic content for this given you may have added ‘Your first name’ to ‘Name’ (below ‘Email’).

Add text question

Note:Power Automate does not like ‘Choice’ or ‘Rating’ questions. There is a work around. While the method is annoying it is relatively easy to implement.

You might find when you attempt to add the dynamic content to such questions the option to do so isn’t available. Yet when adding dynamic content to the previous question the option was listed.

There is a workaround. Assuming you have successfully ran the flow return to the flow history window. Click to open the successful run.

Power Automate history

You should see the below.

Power Automate success

Expand ‘Apply to each’, expand ‘Get response details.’ Under outputs scroll down to the question you have issues with.

Power Automate code preview

Place your mouse cursor in the ‘Outputs’ body. Press the ‘Ctrl’ and ‘A’ key to select all. Then release the ‘A’ key while still holding down the ‘Ctrl’ press the ‘C’ key to copy.

Open ‘Note Pad’ or ‘Note Pad ++’ and place your mouse cursor in note pad and press ‘Ctrl’ and ‘V’ keys to place the copied text.

Note pad plus plus

Notice I have added an expression.

outputs('Get_reponse_details')?['body/r5af09660b24046dc83eb52233d835146']

Click the ‘Edit’ top right to edit your ‘Flow.’

Select the question Flow fails to allow you to add dynamic content. In my case question 5, ‘How likely are you to recommend this event to a friend or colleague?’ To add the ‘Expression’ place your mouse cursor in the box you need to add the content.

Then select the tab on the right ‘Expression’ see image below. 

You will need to add

outputs('Get_reponse_details')?['body/add whatever code you identified here’]

Note: The code is unique so you cannot copy my example below.

outputs('Get_reponse_details')?['body/r5af09660b24046dc83eb52233d835146']

Click OK. 

Power Automate Adding Flow Expression

You should see ‘Outputs.’ When you run ‘Flow’ you will probably see ‘Outputs’ changed to a form dynamic content.

Power Automate Expression output
Power Automate

Tip: If you experience issues amending your ‘Flow’ I suggest you create a new ‘Flow.’ So much easier than trying to find the error. You do not need the stress.

Return to the ‘Flow’ you created to send an email when a visitor to your website fills in your form. Delete ‘Get my profile.’

Edit Power Automate Template

Click the ‘+’ sign below ‘When a new item is created.’ Click ‘Add an action.’

Power Automate Add Action

In the search box type ‘OneDrive’ (1) and click ‘OneDrive’ icon (2). Scroll down to select ‘Get file Metadata.’

Power Automate OneDrive
Power Automate metadata

Next add OneDrive ‘The unique identify of the file.’ Click the folder. In the submenu click the chevon and navigate to the OneDrive file you want to attach to your email.

Note: You could choose another online storage for example OneDrive for business, Dropbox.

Select One Drive Folder
Power Automate requires file location

Next move your mouse cursor below ‘Get file metadata’ to reveal the ‘+ Add action’ and click. In the ‘Choose and action’ search box type ‘Initialise variable’ (1) and select ‘Initialise variable’ (2).

Power Automate  intialise variable

Name your variable for example ‘FormsTutorial.’ For ‘Type’ in the drop down select ‘Array.’ For ‘Value’ leave as is.

Power Automate Initialise variable name
Power Automate variable Array

Click the ‘+ Add action’ below ‘Initialise variable’ and in the search box type ‘OneDrive.’ Click the ‘OneDrive’ icon. Scroll down, to select ‘Get File Content.’

Power Automate OneDrive Get Content
Power Automate OneDrive
Power Automate attach OneDrive file

In the ‘Get file content’ click the folder to navigate to the ‘OneDrive’ folder and select the file you wish to attach to the email.

Folder holding OneDrive file
File location OneDrive

Your next step is to formulate your email. Click to expand ‘Send Email.’ To do this click the ‘Add dynamic content’ plus sign and scroll down and select ‘Email.’

Power Automate add email address

For subject add ‘File name with extension.’

Power Automate add email title

For body </> will need formulate our email text and this needs to be in html. You can use any html editor. If you do have one you could use Outlook. Send an email to yourself using the text you intend. Send that email. When it arrives open the email and right click to select ‘view source.’

Another method is to open the email. From the menu select ‘Message’ in the ribbon ‘Move’ section click ‘Actions’ select ‘Other Actions’ and click ‘View source.’

View email html source
View html email code

Both methods are unsatisfactory. The issue being by default additional code is added see example below.

Email html output

While you could copy and paste the above code example into your ‘Flow’ and it would work. However, you might experience performance issues.

Using ‘Microsoft Expressions Web’ you can create an ‘HTML’ page, type your copy as you would any other text editor. Html is automatically generated. Copy the ‘HTML’ and paste into your ‘Flow’ see below.

Microsoft Expression Web
Email text in HTML format

Next click ‘Advanced options’ drop down (see above image). Your email attachment needs to be added.

Place your mouse cursor in the ‘Attachments Name – 1 box.’ From the popup select ‘Name.’

Power Automate attachment name

Place your mouse cursor in ‘Attachments Content –‘ from the side menu choose ‘File Content’.

Save your ‘Flow.

Check ‘Flow checker’ has passed your flow.

Finally return to your webpage with the form. Fill in the form and submit.

Check your SharePoint online ‘ My List’ and the data should be there.

Return to your ‘Flow.’ All being well your email ‘Flow’ was a great success.

Power Automate success

Check your email.

Received Power Automate  email

Congratulations

If things did not quite work for you. Re-read this article. As you do check your implementation as your read. At the time of publishing both articles were tested by third parties and found to be correct.

Hopefully, you have learnt what you set out to achieve.

Thank you for reading this article. 

Note: It is feasible to have just a single ‘Flow’. Breaking the flow into two keeps the learning process simple and hopefully ensures everyone can follow along and if necessary, debug. If there is a demand, I publish a tutorial illustrating a single flow for this process.

Download a pdf version of this article.


__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"62516":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default Palette","value":{"colors":{"62516":{"val":"var(--tcb-skin-color-0)"}},"gradients":[]},"original":{"colors":{"62516":{"val":"rgb(19, 114, 211)","hsl":{"h":210,"s":0.83,"l":0.45}}},"gradients":[]}}]}__CONFIG_colors_palette__
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"ee969":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default Palette","value":{"colors":{"ee969":{"val":"var(--tcb-skin-color-0)"}},"gradients":[]},"original":{"colors":{"ee969":{"val":"rgb(19, 114, 211)","hsl":{"h":210,"s":0.83,"l":0.45}}},"gradients":[]}}]}__CONFIG_colors_palette__
Previous Article

Christopher Bird


Building your own Power App, BI solution, or automated workflow can be a mind-blowing experience. It can also be a nightmare. Particularly when you begin with a blank screen. My advice, get professional help as and when you need it. That's what successful people do.

Christopher Bird

related posts:




{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get in touch

>