cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to get a comments from a sharepoint list in an email with Power automate?

Hello,

 

How to get a comments from a sharepoint list in an email with Power Automate?

I don t see a value in Power Automate for this!

Are the other trick instant of do it in a column?

 

Kind regards,

SanderSchermafbeelding 2021-03-01 162350.png

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @Anonymous,

 

You can use the following URI to only retrieve 1 comment. Microsoft is automatically sorting it descending, so this will be the last comment.

 

_api/web/lists/getbytitle('@{variables('ListName')}')/items(@{variables('ListItemId')})/Comments?$top=1

 

 

If you want to avoid using a parse json and an apply to each action you can also use an expression to retrieve the correct fields of the comment item.

 

Below is an example of retrieving the text of a comment of the first (and only) item in a compose action by using an index [0] and the text field.

 

outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results'][0]['text']

 

 

textfield_comment.png

View solution in original post

4 REPLIES 4
Expiscornovus
Super User II
Super User II

Hi @Anonymous,

 

You can retrieve the comments by using a Send an HTTP request to SharePoint action.

 

Below is an example which retrieves the comments for one specific list item.

 

_api/web/lists/getbytitle('@{variables('ListName')}')/items(@{variables('ListItemId')})/Comments

 

getlist_comments.png

Anonymous
Not applicable

Thanks its works. But then wanne get the last comment.  If i do that after a parse Json, He is going into an apply to each get if me every comment and a lots of emails :). How to avoid that? So that i get the last comment of the item ?

Expiscornovus
Super User II
Super User II

Hi @Anonymous,

 

You can use the following URI to only retrieve 1 comment. Microsoft is automatically sorting it descending, so this will be the last comment.

 

_api/web/lists/getbytitle('@{variables('ListName')}')/items(@{variables('ListItemId')})/Comments?$top=1

 

 

If you want to avoid using a parse json and an apply to each action you can also use an expression to retrieve the correct fields of the comment item.

 

Below is an example of retrieving the text of a comment of the first (and only) item in a compose action by using an index [0] and the text field.

 

outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['results'][0]['text']

 

 

textfield_comment.png

View solution in original post

Anonymous
Not applicable

Thanks you so much! The idea is always easy and looks easy to do ;). But when you are doing it. Its always a little bit complex in Power Automate 🙂 Thanks

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (53,319)