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 / Copy Sum with name to ...
Power Automate
Unanswered

Copy Sum with name to other SharePoint list

(0) ShareShare
ReportReport
Posted on by 7

Dear All,

 

I have 2 SP list  (List 1 and List 2)

- List 1 is detail item with Name + Quantity

 

I want to make flow that can copy sum Data of each items from list 1 to list 2

List 1

 

hainguyen_0-1672236090229.png

hainguyen_0-1672236424007.png

 

 

List 2

 

hainguyen_1-1672236227032.png

 

 

 

 

Categories:
I have the same question (0)
  • Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @hainguyen 

     

     I have created sample for you

    1. Get All Item from First List

     

    2.

    union(body('Select'),body('Select')) 

    3.

    Use One Filter Array Action

    items('Apply_to_each')?['Name']Name is Column name here

     

    4. Use one compose Action rename to JSON and put value.

    5. Use another compose action Rename to Sum and put Expression.

    xpath(xml(outputs('JSON')), 'sum(/root/Numbers/Quantity)') 

    Quantity Is column name in expression of first List

     

    6. Use create item Action and pass value.

    items('Apply_to_each')?['Name'] 

     

     

    --------------------------------------------------------------------
    If I have answered your question, please mark post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

    Amit_Sharma_8-1672238944719.png

    Amit_Sharma_7-1672238731720.png

    Amit_Sharma_6-1672238619646.png

    Amit_Sharma_4-1672238461182.png

    Amit_Sharma_3-1672238389209.png

    Amit_Sharma_2-1672238350429.png

    Amit_Sharma_0-1672238245725.png

     

  • Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @hainguyen 

    When I Post My Reply, I don't Know How All Thing Collide with each other?

    Please Wait I will recreate For You

     

  • hainguyen Profile Picture
    7 on at

    Hi @Amit_Sharma ,

     

    I follow your instruction, however, what i need i Copy and update Sum data in List 2. 

    your flow it's only copy. Could you please help me to get update if list 1 add more items.

    hainguyen_0-1672241406951.png

     

  • Verified answer
    Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @hainguyen 

    Please follow This as per your requirement.

    1. Use Get Items Action and get all the items from list 1

    Amit_Sharma_0-1672249250813.png

     

    2. Use One Select Action and Select Only Name From get Items Action.

    Amit_Sharma_1-1672249336915.png

     

    3. Use one Compose Action and perform union on body which return by select Action.

    Amit_Sharma_2-1672249411027.png

    union(body('Select'),body('Select'))

     

    4. Then use one Apply to each Action and provide value which return by union.

    Amit_Sharma_3-1672249495879.png

     

    5. In apply to each Action use one filter Action and filter list 1 according to Name (which is current value of apply to each).

    Amit_Sharma_4-1672249635305.png

    Amit_Sharma_5-1672249671788.png

    items('Apply_to_each')?['Name']

     

    6. Then use one compose Action rename to JSON and provide expression.

    Amit_Sharma_6-1672249771428.png

     

    {
     "root": {
     "Numbers": @{body('Filter_array')}
     }
    }

     

     

    7. Then Use one another compose Action rename to SUM and provide expression.

    Amit_Sharma_7-1672249892024.png

     

    xpath(xml(outputs('JSON')), 'sum(/root/Numbers/SL)')

     

    Note: In expression SL is a column name of List 1

     

    8. Use Get item action and list items from List 2 according to filter query.

    Amit_Sharma_8-1672250084875.png

     

    Note: In filter query name also enclose with single quotes.

    items('Apply_to_each')?['Name']

     

    9. Then Use one condition Action.

    Amit_Sharma_9-1672250259245.png

    empty(outputs('Get_items_From_List_2')?['body/value'])

     

    10. create or update list 2 according to condition output.

    Amit_Sharma_10-1672250374343.pngAmit_Sharma_11-1672250425615.pngAmit_Sharma_12-1672250471333.png

    Amit_Sharma_13-1672250506789.png

     

    In Update item Action

     

    Id: 

    outputs('Get_items_From_List_2')?['body/value']?[0]?['ID']

    Title:

    outputs('Get_items_From_List_2')?['body/value']?[0]?['Title']

    Name:

    outputs('Get_items_From_List_2')?['body/value']?[0]?['Name']

     

    Total:

    Amit_Sharma_14-1672250655584.png

     

    Complete Flow

    Amit_Sharma_15-1672250715978.png

     

     

    SPL List1:

    Amit_Sharma_16-1672250743436.png

     

    SPL List2:

    Amit_Sharma_17-1672250767013.png

     

    Hope it helps!

     

     

     

  • hainguyen Profile Picture
    7 on at

    Thank for your detail explanation and support. I really appreciate your help. 

    One again, Thank you very much. !!! and Happy New Year.!!!!

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard