Skip to main content

Send Approvals and Normal email with Multiple Attachments.

Scenario :-  If User Creates new item in sharepoint list then take the attachments from the list and send approval email with attachments and send normal email with attachments.

Step 1:-

                Login to Flow -> search for When an Item is created (from SharePoint ) add it as Trigger. Then add Get Attachments from SharePoint and select the ID from Dynamic content.


Step 2 :-

                Search for Variables and select Initialize a Variable then name the variable as per your interest.

Here it is emailVar & approvalVar.


Step 3 :-

Add  the get attachment content from sharepoint list then add the Site Address and list name .

Choose Id from Trigger Body and File identifier from Get Attachments.

Next click on Add an action inside the loop then search for Append to Array variable choose the variable name which you declared previously  and add the following code to the Value.

{

  "Name": @{items('Apply_to_each')?['DisplayName']},

  "ContentBytes": @{body('Get_attachment_content')['$content']}

}


Once you run the Flow then you will see like this.


Step 4 :-

Click on Add an Action then add  the get attachment content from sharepoint list then add the Site Address and list name .

Choose Id from Trigger Body and File identifier from Get Attachments. Add Append to array variable and choose the variable from the drop-down in the Value paste the below code.

{

  "name": @{items('Apply_to_each_2')?['DisplayName']},

  "content": @{body('Get_attachment_content_2')}

}

 

Step 5 :-

                Add Send an Email in the Attachments choose the emailVar. Reason to choose the emailVar is Send an email card expects the data in ContentBytes .

 

Step 6 :-

                Add the Approvals and in the Attachments choose another variable here it is approvalVar.

 

Happy Learning. 😄👍👍


Comments

Popular posts from this blog

Creating News Application using Flow and Power Apps ( Part -1 )

Create a Flow to fetch the latest news from Public API Step 1 :-                      Login to Power Automate using work or School account . Add a PowerApps Trigger - > add HTTP Action card. **You can find public API which are available online for free. Here is the Top Free News API's. News API, Bing News Search API, Bloomberg API etc.... In this Tutorial I am using News API to fetch the latest news. Just Login to News API and generate API Key. Once you Login to the News API there you will see news from different sources. Choose any one of the source. Once you generate the API Key , redirect to the Flow Portal in HTTP Action Card choose the method as GET and paste the URI [ if you choose any one of the source you will get url with API key included in that]. Choose Authentication mode as None. Step 2 :-                     Now Run the Flow. Copy the Output of HT...

Creating News Application using Flow and Power Apps ( Part -2 )

 Creating PowerApps Screen to view the latest  news. This is continuation of  Previous Article  . Please have look into it if you missed my previous article.  Step 1 :-                      Login to the PowerApps -> Create an app from Blank using Phone Layout.Add Header and Footer using labels -> Add a Refresh Icon from Icons menu. Set the Refresh Icon OnSelect property to this code.   ClearCollect(test12,'Flowname'.Run()); -- test12 is collection name. --Once user press Refresh icon internally it calls the Flow , get the data from Flow in JSON format and stores the data in collection . **You can either write this formula in OnSelect property/ App OnStart property.** Step 2 :-                      Add a Blank Vertical Gallery -> Inside that add another Gallery, choose the layout as Image,Title,Subtitle. Reason for adding...

Using Trigger conditions save the API calls of Flow.

Using Trigger conditions Save the API calls of Flow.  Scenario :-  Trigger a flow when an item is created in SharePoint which includes attachment only .                                 According to the Microsoft official documentation users having Power Automate for office 365/Power Automate per user Plan/ Power Automate per flow Plan will see the difference in API calls.   Usually to achieve this scenario we will create a flow structure like this :- When an item is created -> Condition -> based on the condition will instruct flow to proceed further . If you notice this sample flow it will trigger every time an item is created in SharePoint whether that item includes Attachment or not. Today we are going to learn Trigger a flow only if item contains attachment. Using the Trigger conditions you can save API r...