Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Count total of items per country in one list then update total to another column in another list

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to create a flow that will count the total of items per site/country in List A then populate in List B the total returned in another column for that specific site/country.  Example: count total of staff against London in List A then populate in List B the total. And i need the flow to run every time there is a change to the number of staff in List A for that particular location.

 

Please help!

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    Hi Vinay

     

    furthermore, on this topic 😁

     

    I need to filter that only certain items in two seperate columnds get counted, example:

     

    End Date- i only want the flow to count each and everyone with 'blank' in this column (it keeps counting all current stafff and leavers that have a value in the end date column)

    Job Type- i only need it to count certain job types and leave 1 type of job role out

     

    where can i add a filter or condition for this in this flow?

  • vayinapurapu1 Profile Picture
    233 on at
    Re: Count total of items per country in one list then update total to another column in another list

    Glad we have made it finally!! Appreciated. Would you mind accepting my thread that helped for you 'As a solution'? 

     

    Cheers,

    Vinay. 

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    And finally we have done it!!! Thank you so much for all the patience and tutorials, step by step!

    i changed the column 'Country' right at the start with 'Country1' so that is why it was always coming up with Column Country was not found 😙

    Thank you so much for all the help on this request, now i just need to apply it to my actual Lists 🙂

  • Verified answer
    vayinapurapu1 Profile Picture
    233 on at
    Re: Count total of items per country in one list then update total to another column in another list

    hello there sorry. I tried to export and import the flow to my other dev tenant, but it is failing. Not sure if this is because of recent updates from Power Automate or some policy in my other dev tenant. How ever i have taken extra steps and tried creating step by step. I have followed the same instructions during the document creation and it is giving me expected output. Can you please refer to the Git hub repo share your feedback? 

    https://github.com/vayinapurapu/UpdatingListProperties/blob/main/Updating%20list%20properties_Step_By_Step.docx 

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    Hi VInay

    I changed the column 'Country' in the Requests list to a look up which i never had before.

     

    Still getting the same error that the column 'Country' does not exist:  Column 'Country' does not exist. It may have been deleted by another user.

  • vayinapurapu1 Profile Picture
    233 on at
    Re: Count total of items per country in one list then update total to another column in another list

     Can you please check this 7 minute video i did it. https://youtu.be/LIRQrXFjNW8?

     

    have you defined the filter query as mentioned in below screen shot? 

    vayinapurapu1_0-1665629620512.png

     

    You are almost close. I have explained the filter query in the video.

    Hope this helps.

     

    Thanks,

     

    Vinay. 

     

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    Hi, so the Github download helped get further-Thank you!!

     however, i am getting this error: 

    LearnDayByDay_0-1665400933410.png

    Does the Country Column in the Requests list have to be renamed from Title to Country? i have created the list exactly how you have it though.

    LearnDayByDay_1-1665401013234.png

     

     

  • vayinapurapu1 Profile Picture
    233 on at
    Re: Count total of items per country in one list then update total to another column in another list

    You are very close. Can you please follow from Step 6? You still need to configure couple of actions inside apply to each

    Updating List Properties Using Flow (c-sharpcorner.com)

    Inside apply to each, you need to select the 'Outputs' of country names

    For each country name, filter the 'Requests' list using filter query 

    vayinapurapu1_0-1664254931750.png

    If the length of the collection is greater than or equal to 1, then update the item in 'Countries' list. 

    vayinapurapu1_1-1664255068976.pngvayinapurapu1_2-1664255084456.png

     

    I have also updated the flow in Github. Can you please try downloading it and check. You should be able to figure it out. If still get stuck Please let me know. 

    vayinapurapu/UpdatingListProperties (github.com) 

     

    Hope this helps. 

     

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    i have followed the Steps exactly how you typed it and my flow looks different to yours:

    LearnDayByDay_0-1663682332013.png

    If you can, please let me know if we can arrange a Teams or Whatsapp call to go over this.

  • LearnDayByDay Profile Picture
    Microsoft Employee on at
    Re: Count total of items per country in one list then update total to another column in another list

    i have, this is what i get:

    LearnDayByDay_1-1663672233523.png

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow