Im following the solution found here: Solved: Exporting SharePoint List Comments - Beginner Frie... - Power Platform Community (microsoft.com), altough to be specific, the one that the user then suggested on β03-15-2023 07:19 PM
I'm getting only the first comment for that item and apart from that, a bunch of text like "Author: {"__metadata":{"type":"SP.Sharing.Principal"},"directoryObjectId":null,"email":"
All the needed info is there but it is buried with all that extra text. So, what is lacking in that flow to make it so it collects all coments and only shows the necessary info (date, author, text, etc)
This is the flow I'm working with:
1- Spanish, sorry π But they are all string variables
This is another string variable, then Get Items, then the HTPS
2-
the condition set that the Body of the HTPS action contains "Results": []
The JSON code is the same the other guy used. Meaning:
A for each following the JSON, setting all the created string variables to the values I want
A Compose action for all the created variables except the one that will have all "todo junto". And the append to string action to add to that variable the rest of variables with the outputs of the recent compose one. This closes the For all and conditional.
Adding the variable to the sharepoint list column.
As mentioned, it does have all the data I need, but not user friendly. And only for the first comment.
I managed to do it as I wanted π With chatgpt lol @eliotcole
I used:
concat(
item()?['author/name'],
' comentΓ³ ',
item()?['text']
)
So if i comented hello it would just be "Ricardo comentΓ³ hola".
Thank you soooooooooooooooooo much again!
Hey again @eliotcole, thanks for sticking with me through this.
So, I recopied the HTML after the HTTP action and now the dynamic ['d/results'] showed up as you screenshot. However, I get the comments like this:
<p><strong>By: <em><a href="NAME@EMAIL.COM">FIRST AND LAST NAME</a></em></strong><br/>CommentedCOMMENT</p>
Would it be possible to get it without those strong and <p> things?
Just "By: Ricado
Commented: "hello"
Yeah ... pretty much:
@WorkingRicardo wrote:
Oh for this actionof SelectResultstoHTML how did you get the dynamic content for results? I used an expression "
body('Enviar_una_solicitud_HTTP_a_SharePoint')?['d/results']". Is that right like that?
You also asked:
@WorkingRicardo wrote:
@eliotcole Omg that put the comments in all items! Altough it put the whole of the metada π
Would it be possible if I commented: hello to get it like this:
"By: Ricardo@email.comCommented: "hello"
So ... if you look at the end of my reply you will see the concat() which is in the Mapa/Map field of the select.
Each of those there is just referring to either a piece of text that is being inserted:
'<p>'
... or picking some data from the item() to insert:
item()?['Author']
Then it just pulls it all together!
To make it not have the date, just edit the first few parts:
concat(
'<p><strong>By: <em><a href="',
item()?['author/email'],
'">',
item()?['author/name'],
'</a></em></strong><br/>Commented: ',
item()?['text'],
'</p>'
)
Which makes me notice that I'd made an HTML error in my previous reply so I have updated that now!
@eliotcole Omg that put the comments in all items! Altough it put the whole of the metada π
Would it be possible if I commented: hello to get it like this:
"By: Ricardo@email.com
Commented: "hello"
Oh for this actionof SelectResultstoHTML how did you get the dynamic content for results? I used an expression "
Maybe because I did it this ways is why I can't get it fully correct.
At the moment it works but would be difficult to explain to my colleagues how it is... They did told me they only need it by who and the what, no date needed. I say by email because maybe its easier to get it, as by name the claims and all that data would need to be removed somehow... I mean if its possible I'd preferred it before the email.
Ty again so much! I didn't know you could copy Flows like that :o!!!
First up, thanks for updating the question, @WorkingRicardo, that is really great information and helps a lot. π π
I've made something that slightly resembles your flow, here:
If you want you can make yours very similar to that, by adding an action after your 'Enviar una solicitud HTTP a SharePoint' action, going to the 'My clipboard' tab, and then paste this in:
{"id":"b5238f28-d447-40e4-a724-514bd13caa33","brandColor":"#484F58","connectionReferences":{"shared_sharepointonline_1":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/shared-sharepointonl-70a14524-6d74-4196-b1fc-31d350117f82"}},"shared_sharepointonline":{"connection":{"id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline/connections/d77dac51a9a54000bd7e766fd7769f04"}}},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iLTQgLTQgNjAgNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogPHBhdGggZD0ibS00LTRoNjB2NjBoLTYweiIgZmlsbD0iIzQ4NEY1OCIvPg0KIDxwYXRoIGQ9Ik00MSAxOC41di03LjVoLTMwdjcuNWg1LjY0djEzLjgzbC0zLjI4NS0zLjI4NS0xLjA2NSAxLjA2NSA0LjAzNSA0LjA1Ljg3Ljg0aC02LjE5NXY2aDEzLjV2LTZoLTYuOWwuODU1LS44NTUgNC4wMzUtNC4wNS0xLjA2NS0xLjA2NS0zLjI4NSAzLjI4NXYtMTMuODE1aDE1djEzLjgzbC0zLjI4NS0zLjI4NS0xLjA2NSAxLjA2NSA0LjAzNSA0LjA1Ljg3Ljg0aC02LjE5NXY2aDEzLjV2LTZoLTYuOWwuODU1LS44NTUgNC4wMzUtNC4wNS0xLjA2NS0xLjA2NS0zLjI4NSAzLjI4NXYtMTMuODE1em0tMjguNS02aDI3djQuNWgtMjd6IiBmaWxsPSIjZmZmIi8+DQo8L3N2Zz4NCg==","isTrigger":false,"operationName":"Condition_MoreThanOneResult","operationDefinition":{"type":"If","expression":{"greater":["@length(body('Enviar_una_solicitud_HTTP_a_SharePoint')?['d/results'])",0]},"actions":{"SelectResultsToHtml":{"type":"Select","inputs":{"from":"@body('Enviar_una_solicitud_HTTP_a_SharePoint')?['d/results']","select":"@concat(\r\n '<p><strong>', \r\n item()?['createdDate'], \r\n ' - <em><a href=\"', \r\n item()?['author/email'], \r\n '\">', \r\n item()?['author/name'], \r\n '</a></em></strong><br/>', \r\n item()?['text'], \r\n '</p>'\r\n)"},"runAfter":{}},"JoinHtmlForCommentarios":{"type":"Join","inputs":{"from":"@body('SelectResultsToHtml')","joinWith":"\n"},"runAfter":{"SelectResultsToHtml":["Succeeded"]}}},"runAfter":{"Enviar_una_solicitud_HTTP_a_SharePoint":["Succeeded"]},"metadata":{"operationMetadataId":"a3f9c522-ebe8-4278-a6e0-58a55202d9bd"}}}
You can see the two Select actions there and you can also see that I am using a more accurate way to test if there are any comments. The expression in the left side is calculating the amount of comments for the list item:
length(body('Enviar_una_solicitud_HTTP_a_SharePoint')?['d/results'])
Then the condition and right side check that the number calculated is greater than 0.
All you would need to do after this is to place your 'Actualizar elemento' ('Update item') action and in the 'commentarios' value add the output from the 'JoinHtmlForCommentarios' action that I made.
It might look something like this, then:
The 'SelectResultsToHtml' action is where I did a bit of clever stuff using the following expression with a concat() function connecting together pieces of text and values from the comments request results into one HTML paragraph.
concat(
'<p><strong>',
item()?['createdDate'],
' - <em><a href="',
item()?['author/email'],
'">',
item()?['author/name'],
'</a></em></strong><br/>',
item()?['text'],
'</p>'
)
Because this sits in the 'Map' section of the Select action, it can address each item() programmatically. To select an individual key's value with the item() funtion you would use something like item()['keyName']. This would then place the value of that key name into the produced Select.
Even though the above looks complex, it is actually making a simple array, with only text entries. Each entry will correstpond to the comment that was entered, and makes its own '<p>' information for the HTML. π
Hey guys! Thanks you both with your replies. I edited my first post to show my full flow. Sorry its in Spanish, I tried to translate where needed.
@Expiscornovus Thanks for the suggestion! I read the blog post and ugh... Couldn't understand much of it. I'm still a novice at all this π
@eliotcole And noooo! Thanks for explaining that. I literally have 0 base knowledge of coding so that helped a it π
Anyhoooow. Having my flow, do you know where I should put the "For each" so it grabs all comments? Or how I could simplify even the text?
Ty in advance!
Hi, @WorkingRicardo, a brief look at that solution shows an awful lot of Apply to each and Parse JSON actions.
Whilst these are simple enough when you are building, they can introduce problems if the Parse JSON does not have a very specific setup (allowing for NULL values and suchlike), which result in flow issues.
Plus, since it leans on HTTP actions, this somewhat makes it in odds to the Parse JSON stuff.
I hope that the next part does not come across in a condescending manner, but I would advise that you familiarise yourself with a few JSON concepts:
There are tutorials and guides online which will give you more understanding of these, but essentially they are things you will commonly use in flows. You will build up more knowledge with them the more that you use them. I've added some real simple examples in the below spoiler.
{
"key": "value",
"key2": 2,
"key3": true
}β
[
"Value 1",
"Value 2",
"Value 3",
"Value 4"
]β
[
{
"key": "value 1",
"key2": 1,
"key3": true
}β
{
"key": "value 2",
"key2": 2,
"key3": false
}β
{
"key": "value 3",
"key2": 3,
"key3": true
}β
]β
I think, though, in order for anyone to help you more with this it would be better for you to update your original question (above) with imagery of your flow embedded into the question. I specifically mention to embed it (use the camera button in the editor) because
Hi @WorkingRicardo,
Can you share a screenshot of your current flow setup? This will help troubleshoot why you are only getting the first comment and not the rest of the comments.
It looks like the solution you are referring to loops through all the comments via an apply to each and the results property. So in theory that solution should retrieve all comments.
Alternatively, you could also have a look at this blog from @DamoBird365 about list comments:
https://www.damobird365.com/microsoft-list-add-comment/
In that blog he has a section about reading all comments and formatting it into readable format. That might also be a good one to have a look at.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2