Hi everyone, I've followed this blogpost (https://divyeshkotadia.wordpress.com/2023/04/21/how-to-export-list-items-with-comments-into-excel-csv-file-using-power-automate/) and it has me 95% of the way there but there are two issues.
1. The @mentions in comments when they are linked in o365 do not show the username/email of the individual but the replace function the creator used. (if you are viewing the blogpost this is the step I'm referring to Replace mentions in comment)
For instance it should be @John Smith but it says @mention{0} instead. I'm not quite sure why this is and how to resolve it. We have sometimes 10+ comments on a single Sharepoint list item with multiple people mentioned in the comment so I would love to get this resolved.
2. This issue is less important but the comments are listed newest to oldest, how can I get them to list oldest to newest (first comment to latest comment).
Thank you in advance!
Solved - moved the MentionID integer reset to AFTER the loop.
Figured this out by reseting the mentionID integer to -1 within the loop
New problem: multiple @ mention IDs do not get updated within the one comment, only the first one!
I have a similar issue- I can generate a correct replacement for the first @mention ID - but each @ mention after the first one returns the @mention{0} instead in the CSV
Hi @Mag1c,
To add those fields you can include them in the first Select, directly after the Send an HTTP request to SharePoint action. You also need to change the expression for the Text field as well, that it does not include the date time anymore.
Below is an example
1. Changed the Select to use the below
{
"Created": @{formatdatetime(item()?['createdDate'],'dd-MM-yy HH:mm')},
"CreatedBy": @{item()?['author/Name']},
"Text": @{item()?['text']},
"Mention": @{item()?['mentions']?['results']}
}
2. Change the Add a row action to use the below of the two new fields
item()['CreatedBy']
item()['Created']
3. The export should now look like the below
@Expiscornovus THANK YOU SO MUCH! I just have a couple of follow up questions, how can I add a column with the creator/user who submitted the comment (submitted by) and the date/time stamp of when they added it? I've tried a few things but I'm missing something.
Lastly, it looks like it's not handling special characters well, specifically the "&" and ":". For the "&" it says "&" and the ":" it says ":". Not really huge issues as I can resolve them with power BI, as that's how I plan to merge the comments to a single row anyways.
THANKS AGAIN SO MUCH, nearly there!
Hi @Mag1c,
I think you are pretty close. In that case I would suggest to add a Add a new row in table action directly after the Join Objects action (still within the Apply to each loop).
Below is an example
ID field of my table uses
items('Loop_through_items_for_comments')['id']
Comment Text field of my table uses the Outputs of the Join Objects action
outputs('Join_Objects')
Test result is the below
@Expiscornovus My compose action was outside of the apply to each loop but even when I add it inside I still get an error:
Just to refresh as this has been an issue going on a couple of weeks... the initial flow I was using works but has the issue with the @mention in comments showing the code instead of the user's name. - https://divyeshkotadia.wordpress.com/2023/04/21/how-to-export-list-items-with-comments-into-excel-csv-file-using-power-automate/ this is the flow I'm referencing.
You suggested this flow - https://www.damobird365.com/microsoft-list-add-comment/ , to resolve the issue, which it does but only for a single ID in a sharepoint list, not all the of rows/IDs in a sharepoint list which is what I need. I am attemping to export all of the comments out of the list one time.
Essentially, I just need help converting https://www.damobird365.com/microsoft-list-add-comment/ from one single ID to exporting all of the comments in a SP list to a spreadsheet. I tried combining the two referenced flows but am clearly having some issues.
I hope that helps provide some clarity on this and you can help me resolve, I really appreciate it!
Hi @Mag1c,
Sorry, I get a lot of notifications so I missed this one again, my bad 😅
My guess is that the compose is in the wrong location. Is that compose action outside the apply to each loop? If that is the case you will get this error message. Place the compose within the loop.
Btw, if you want to store all text you probably want to use a string variable (initialize variable action at the beginning of your flow) and use an append to string variable action at the end of each loop.
stampcoin
87
Michael E. Gernaey
70
Super User 2025 Season 1
David_MA
48
Super User 2025 Season 1