Skip to main content
Community site session details

Community site session details

Session Id : B7NhxBh6IbEJN41ZtSySSl
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 4 Apr 2024 12:23:45 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 04 Apr 2024 at 13:40:36
    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 04 Apr 2024 at 13:06:31
    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 2 on 04 Apr 2024 at 13:02:34
    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 04 Apr 2024 at 12:50:08
    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 2 on 04 Apr 2024 at 12:43:06
    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading started