web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Export Sharepoint list...
Power Automate
Answered

Export Sharepoint list items with comments into CSV file

(2) ShareShare
ReportReport
Posted on by 43

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)

Mag1c_0-1698174553761.png

 

 

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!

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Mag1c,

     

    Have a look at the Read ALL comments part of this blog from @DamoBird365https://www.damobird365.com/microsoft-list-add-comment/

     

    That blog demonstrates how to replace those references with the actual names of the people mentioned by using a couple of Select actions and some expressions with split and replace functions.

  • Mag1c Profile Picture
    43 on at

    I appreciate your response. I tried following the blog but I get an error “the action join_objects is nested in a foreach scope of multiple levels. Referencing repetition actions from outside the scope is supported only when there are no multiple levels of nesting"

    This is due to the REST API call to fetch all comments being a loop because I want to pull all of the records and its comments from a list, not just a single record and its comments. Any ideas on how to work around this?

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Mag1c,

     

    It should also be possible to retrieve all comments from all items.

     

    Because you already have a for each loop that one from the blog would be a nested one. That also means that you would have to update the expressions which are being used in the blog to point to the right for each loop action. Make sure that is is using the correct action name in the items function.

     

    Can you share a screenshot of how you added the actions from the blog. This way I can easier point to what you need to change/update to make this work.

  • Mag1c Profile Picture
    43 on at

    Sure, I've attached 3 screenshots of my flow. I changed the original quite a bit to add in the parts from the blog you mentioned and haven't cleaned it up yet as I'm testing so there are still some variables listed that won't be needed once it's working.

  • Mag1c Profile Picture
    43 on at

    Hello @Expiscornovus @I provided 3 screenshots if you’re able to assist me with the error. Thanks!

  • Mag1c Profile Picture
    43 on at

    Bumping this topic in case anyone can assist, thanks!

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Mag1c,

     

    Apologies for the delayed reply and thanks for sharing those screenshots. 

     

    It looks like the issue might be in your Join Objects action. However, it the screenshot it is collapsed. I cannot see what your are using in that action. Can you share what you used in that action?

  • Mag1c Profile Picture
    43 on at

    I've just copied/pasted the expression from the article you posted:

    if(equals(length(item()?['mention']),0),items('Apply_to_each')?['text'],concat(join(body('Select_Text_and_Replace_Mention'),''),last(outputs('Split_on_Mention_Compose'))))
  • Mag1c Profile Picture
    43 on at

    I think the issue is with my expression in the compose action. The article says this

    Mag1c_0-1699367559728.png

    but if I put exactly that code in as an expression it gives me an error saying it's invalid

     

    @{outputs('join_objects')}

     

    If I try it as the below code, it saves the expression but when I click save on the flow is when I get the error below.

     

    outputs('join_objects')

     

     

     

     Flow save failed with the code 'invalidtemplate' and message 'the template validation failed: 'the inputs of the template action 'compose' at line '1 and column '5290' cannot reference action 'join_objects'. The action 'join_objects' is nested in a foreach scope of multiple levels. Referencing reptition actions from outside the scope is supported only when there are no multiple levels of nesting.

     

  • Mag1c Profile Picture
    43 on at

    Bumping again to see if anyone is able to assist with this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard