How to add comment to SharePoint List Item using Power automate

Hello everyone and welcome to my blog. In today’s blog, I will show on how you can add comment to a SharePoint list item using Power Automate.

Comments are a great feature to add information for SharePoint list item. You can put in additional information for each list item and also tag users. Once you tag them, they will receive a notification too.

Below is a comment for a list item.

That’s great. But how to achieve this using Power Automate? Surprisingly there is no straightforward way to do this. This is because Comments is a not a field in the list item.

For this demo I used a Manual trigger. I have the following inputs.

The next step is to connect to SharePoint to post the comments. For this we need to use the action – “Send an HTTP request to SharePoint”.

Below is the configuration for the action.

  1. Site Address -> Address of your SharePoint site collection
  2. Method -> POST
  3. Uri – _api/web/lists/getbytitle(‘<your list>’)/items(‘<list_id>’)/Comments

Now the most important part. How do I post the comments? To do that, we need to create a JSON in a specific format. And below is the format.

{
   "text": "This is a comment from Power Automate. Tagging @mention{0} and @mention{1}",
   "mentions": [
      {
         "email": "mentionuser@email1"
      },
      {
         "email": "mentionuser@email2"
      }
   ]
}

And here we go after I replace them with placeholders.

When the run the flow, the comment is added successfully to the list item.

Hope you liked this post. If this post has helped, you can buy me a coffee.

For similar topics on Microsoft.NET and Power Platform, subscribe to my blog using the Subscribe option on right pane.

You will also like the below posts.

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading