Hello,
I’m using “GET” to capture all list items that have a ‘canceled’ status. Then adding a “Send HTTP Request to SharePoint” to capture the associated list comments, for those items. When my FLOW runs, it only outputs the items that actually have comments and ignores the other canceled items. I wish to send an email containing ALL canceled items with their associated comments and display N/A, if no comments exist. Can someone please advise what steps I might be missing here and how I need to adjust my FLOW? I’m very new to Power Automate, so any assistance, especially with screen shots is appreciated.
Thank you,
MKT
Solved! Go to Solution.
Here is a flow that grabs all comments for a SharePoint List and sends them as an email.
The body of the email consists of the SharePoint item ID followed by the comments, if any:
Here is the high-level flow:
Staring with Get items, and initializing variables:
(2) Apply to Each loop - for each SharePoint list item, get the comments using a SharePoint REST API:
Use Send HTTP request to SharePoint to get the list item comments:
_api/web/lists/getbytitle('Managers List')/items(@{items('Apply_to_each')?['ID']})/Comments
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
Store the comments in a compose action. Note the comments are returned as an array.
Compose action:
@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/d/results']}
Now check to see if there are any comments :
length(outputs('Compose_Results'))
Yes, true condition - there are comments:
No, false condition - there are NO comments:
Finally the send mail action:
Hope this provides some guidance.
Ellis
Adding a summary screen shot of entire flow:
See the following post: Get Microsoft Lists Comments using Flow
Ellis
Thanks Ellis, I am able to get the comments. My problem is figuring out how to output items in an email that don't have comments, along with those that do.
Thanks,
MKT
Here is a flow that grabs all comments for a SharePoint List and sends them as an email.
The body of the email consists of the SharePoint item ID followed by the comments, if any:
Here is the high-level flow:
Staring with Get items, and initializing variables:
(2) Apply to Each loop - for each SharePoint list item, get the comments using a SharePoint REST API:
Use Send HTTP request to SharePoint to get the list item comments:
_api/web/lists/getbytitle('Managers List')/items(@{items('Apply_to_each')?['ID']})/Comments
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
Store the comments in a compose action. Note the comments are returned as an array.
Compose action:
@{outputs('Send_an_HTTP_request_to_SharePoint')?['body/d/results']}
Now check to see if there are any comments :
length(outputs('Compose_Results'))
Yes, true condition - there are comments:
No, false condition - there are NO comments:
Finally the send mail action:
Hope this provides some guidance.
Ellis
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
If you are a small business ISV/Reseller, share your thoughts with our research team.
User | Count |
---|---|
26 | |
25 | |
22 | |
22 | |
11 |
User | Count |
---|---|
45 | |
33 | |
31 | |
30 | |
30 |