JOIN OVER 3,000

Subscribers who get fresh content to help their business weekly...

Categories
Categories

In the current situation Email is one of the most important actions used in our day to day life to transfer data or send information between specific people or a group of people. This article explains how the email can be sent on item selection , you might think there are many other options to use like send email, block or create an item and send an email or once a document is approved send email but this is also a way through which an email can be sent.

1.Creation of SharePoint list

Create a SharePoint library with the fields necessary.

We can create a flow by directly opening Power Automate (https://powerautomate.com/ ) or directly opening from the list / library.
To open from the list/library select the Automate option from the ribbon → Create a flow

Once you click on create a flow a small box opens in the right side ,scroll down and click more it redirects to the flow page

from New select the template Automated-from the blank

Step 1 – Select the action “On selected item “Select the site address , list name and the view name from the drop down.

Step 2 – Get the properties of the selected file using Get files (properties Only ) action and filter the document using the id i.e., ID eq ‘ID’ as shown below and then select the view from which this item fetches the data.

Step 3– Retrieve the data from the above action and parse it to the Json, since the flow understands JSON/Xml format. To do so use PARSE JSON action.

Note – In order to create JSON schema try to run the flow with the first two steps and copy the get file properties body block and paste the same in the JSON schema.

Step 4 – Get the SharePoint group user Id’s from the group by using “Send HTTP request to SharePoint” action.
Use method as GET
Uri – _api/Web/SiteGroups/GetByName(“Group name”)/users?$select=Email,Id
Header – Accept, application/json;odata=nometadata

Step 5 – Finally send email using “Send HTTP request to SharePoint” action”.
Use method as POST
Uri – _api/SP.Utilities.Utility.SendEmail
Header – Accept, application/json;odata=verbose ,
Content-Type, application/json;odata=verbose

Body – {
‘properties’: {
‘__metadata’: {
‘type’: ‘SP.Utilities.EmailProperties’
},
‘To’: {
‘results’: [‘Group name’]
},
‘Body’: ‘<p>Dear members, <br> <br>
A new document is uploaded:
<ul>
<li>Document: “select from the dynamic content “</li>
<li>Description “select from the dynamic content “</li>
</ul>
Best Regards <br> <br>
‘Subject’: ‘A new document is uploaded ‘Title’ (Select from the dynamic content’)
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *