Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create a total of attachments in sharepoint items and then display in HTML Table

(0) ShareShare
ReportReport
Posted on by 27

I have a flow that goes through the filtered items and inside the apply to each i have a compose that totals the attachments for each item.

 

Compose: length(outputs('Get_attachments')?['body']) - the outputs of this compose are correct but i then need to create an HTML table that will show the total attachments for each item on a separate row along with some other items from that SharePoint list.

Whatever i try at the min the totals are coming back and one entry on the HTML table or like the below:

 

Item 1:

andrewp3283_0-1712233253513.png

 

Item2 (contains both item 1 and 2)

andrewp3283_1-1712233292189.png

And so on with the next item etc, what should be happening is it should read:

 

Item1: 3

Item2: 0

Item3: 3

Item4: 6

 

Thanks in advanced

  • andrewp3283 Profile Picture
    27 on at
    Re: Create a total of attachments in sharepoint items and then display in HTML Table

    thank you so much i think that has sorted it for me

  • Verified answer
    v-yetonggu-msft Profile Picture
    on at
    Re: Create a total of attachments in sharepoint items and then display in HTML Table

    Hi @andrewp3283 ,

    @ManishSolanki approach is correct, I appreciate it very much.

    But if you want to add other item fields in addition to the images field, please check my test flow.

    The Result:

    vyetonggumsft_0-1712235681177.pngvyetonggumsft_1-1712235711684.png

    vyetonggumsft_2-1712235840954.png

     

    {
    "images":@{length(outputs('Get_attachments')?['body'])},
    "Title":@{items('Apply_to_each')?['Title']},
    "Subject":@{items('Apply_to_each')?['Subject']}
    }

     

    My SharePoint List:
     

    vyetonggumsft_3-1712235977417.png

    Best Regards,

    Sunshine Gu

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create a total of attachments in sharepoint items and then display in HTML Table

    Here is the sample:

     

    In "Create HTML table", set 'Columns' parameter to 'Custom' and add an expression in the header value. Expression needs to be added in the expression box as shown below:

    ManishSolanki_0-1712235616027.png

    item()

     

    Output:

    ManishSolanki_2-1712235822692.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • andrewp3283 Profile Picture
    27 on at
    Re: Create a total of attachments in sharepoint items and then display in HTML Table

    thanks for the quick reply i will post the flow, but as a test my HTML Table inputs look correct its the outputs that are not?

    andrewp3283_0-1712234994188.png

     

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Create a total of attachments in sharepoint items and then display in HTML Table

    Hi @andrewp3283 

     

    Could you please share the screenshot(s) of the entire flow in edit mode?

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >