Create and Delete items In a List by Using Flows & Embed HTML Code in Mail.

Loading

  • Embed HTML Code in Mail
  • Create item in another list
  • Delete item using flow
  1. Go to power automate Home page -> Create -> Automated Cloud Flow

Give it a flow name and select the trigger option “When an item is created” in SharePoint

1.Embed HTML code in Email :-

Add “Get items” action to the flow to display the items of SharePoint in flow

Here we are using “condition” action in the flow where i am adding a condition i.e Department (column) is equal to ‘Admin’ . when the condition is true i will get a mail. For getting mail Add a “Send an email (v2)” action to the flow in “if yes” step.

Now add the “To Address” & “Subject” & “Body”. First add the basic details of the list in the body as shown below.

Now select the HTML(</>) option in the top display and add the HTML code in the body

<h1> :-header

<br> :-break

<p> :- paragraph

<a> :- hyperlink

<table> :-to display the content in tabular format

<tr> :- will indicate a row in a HTML table

<td> :- Defines a standard data cell in an HTML table

After adding HTML code in the body save the flow and test it automatically by using recent flow in which the condition will satisfy. so the flow will trigger and will get a mail .

Now The mail before adding the HTML will be shown like this.

The mail with HTML code will be shown like this which include the link which will direct us to the list directly. when we compare both mails we can see the difference.

2.Create Item in Another List :-

First Go to share point site and create a list from existing list because we need to create the items in the list by using existing list content. Name the list and save it.

Now select the list which is already existed in you site. Here the existing site is “CT list” by using which we are going to create an item in another list.

The format of the new list looks like existed one. where the columns are same in both the lists .

Now go to your flow and add a “create item”(SharePoint) action to the “if no” condition . Add the site & List address to the action as shown below. Save the flow and try to test it.

The Existing list will be shown below.

Now add an item to the existing flow as shown below.

Check the new list by refreshing the page you will see the same item will be created in the new list as shown below.

3. Delete item using flow :-

Add “Delete item “(SharePoint) action to the flow after the create action and give the details of site and List address. Save the flow and test it.

Add an item to the existing list and save it.

The item which we created in the existing list will be also created in the new list as shown below.

Check it again by refreshing it now the item will be deleted from the new list and existed list.

The item which is deleted will be stored in the Recycle bin as shown below.

Leave a Reply

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