How to instantly sum an Array of numbers in a Power Automate Cloud Flow

  Рет қаралды 16,899

Paul Murana

Paul Murana

Күн бұрын

This is the ultimate performance method of summing an array in Power Automate. I used this method to sum an array of 100,000 records in less than 1 second using the powerful xpath function. Normally you would use an apply to each loop, but with this method there is no need.
You can save flow actions and get maximum performance with the xpath method, which is simple to do. Full details on the blog post: www.tachytelic...

Пікірлер: 70
@PaulieM
@PaulieM 6 ай бұрын
Check out my new method of summing an array, even easier than this one and no messing around with xpath! kzbin.info/www/bejne/iquUdoKEmdmkrK8 🙅
@wj04
@wj04 21 күн бұрын
just so i understand. PowerTools is a $195 add on for power automate?
@takocalvin
@takocalvin Ай бұрын
Thank you for revealing the hidden gem! I couldn't sum or set a variable inside the "Apply to each" action.
@jasonhawkins3977
@jasonhawkins3977 Жыл бұрын
You bloody Legend! I'll never sum the standard way again! For big datasets this is the only way to sum without it taking literal hours. Thanks Paulie!
@PaulieM
@PaulieM Жыл бұрын
The standard way for large datasets is useless really. Glad it helped.
@zYxMa
@zYxMa 2 жыл бұрын
Amazing solution. Why didn't Microsoft include a SUM function is beyond me, yet this is extremely simple and will potentially save hours (and in some cases DAYS!!!) in generating reports for me :)
@aaronwang4111
@aaronwang4111 Ай бұрын
It solved my problems for years
@jenefermonroe5999
@jenefermonroe5999 Жыл бұрын
Wow! This was amazing. I'm glad I didn't give up before I found your video!
@PaulieM
@PaulieM Жыл бұрын
It’s a good (but slightly strange) solution.
@KaranThukral15
@KaranThukral15 7 ай бұрын
this video deserves an award!!!!
@PaulieM
@PaulieM 6 ай бұрын
Thank you Karan! Award Accepted 🤣
@josephansah
@josephansah 3 жыл бұрын
Thank you very much Paulie. Recently discovered your videos and I must say that I really enjoy good content. I have watched a few and learnt something different and not so obvious in all of them; straddles the line between intermediate to pushing on advanced learning. Maybe not in this simpler example, but at least in the other videos I have seen 🙂 More grease to your elbows.
@PaulieM
@PaulieM 3 жыл бұрын
Thanks Mojo! Glad you are finding the videos useful. I must do another one soon!
@josephansah
@josephansah 3 жыл бұрын
@@PaulieM No rush, but your videos are worth the weight in gold, so please do 🙏🏾 Full of gems with no fluff. I would vote for another example involving the Outlook group HTTP request you previously demoed. Jaw dropped again when you showed what that can do. Best regards.
@AthertonSquire
@AthertonSquire 4 ай бұрын
Paul thank you for this worked a treat
@JenniferLaveryFBE
@JenniferLaveryFBE 11 ай бұрын
Finally! Something that doesn't seem needlessly convoluted. :)
@PaulieM
@PaulieM 11 ай бұрын
Thanks! It’s still more complicated than it should be in my opinion! A dedicated sum action wouldn’t be a bad addition!
@madhavadhatrao3528
@madhavadhatrao3528 Жыл бұрын
You are the best Paul. Such great content ,Thank you so much
@PaulieM
@PaulieM Жыл бұрын
I appreciate that! Thank you! 🙏
@dexter2424
@dexter2424 Ай бұрын
You made my day with this video, thank you! :)
@kingsleyudeagha
@kingsleyudeagha 2 жыл бұрын
You are the best Paul. Such great content for free. Amazing.
@PaulieM
@PaulieM 2 жыл бұрын
Hi Kingsley, I really appreciate the kind words. Thank you 🙏
@DaniBored
@DaniBored Жыл бұрын
Thank you sir, you saved me. I had been trying to do this for a day ! 😄
@PaulieM
@PaulieM Жыл бұрын
Glad it worked for you. It is a real shame there isn't a built in SUM function.
@arshad801
@arshad801 3 жыл бұрын
Always good to learn something new
@RahulSharma-em6en
@RahulSharma-em6en 3 жыл бұрын
Thank you very much for such clear and informative video.
@taffyosborne9661
@taffyosborne9661 3 ай бұрын
Game changer thanks Paul
@RyanEverhart1350
@RyanEverhart1350 3 жыл бұрын
Worked great! Thank you so much!
@nguyenmanhtuan1772
@nguyenmanhtuan1772 Жыл бұрын
Its works for me, thank you a lot Sir
@coraguerrier5732
@coraguerrier5732 3 ай бұрын
Thank You!!! I am going to use this.
@PaulieM
@PaulieM 3 ай бұрын
Great stuff! The pinned comment is an even better way though 😜
@AdministratorEmail-m4n
@AdministratorEmail-m4n Жыл бұрын
Thank you. Great tip!
@adrianflores8432
@adrianflores8432 10 ай бұрын
It's laughable that all of this is necessary to... make a sum. Thanks for the video
@PaulieM
@PaulieM 10 ай бұрын
Agree, a sum function is required.
@gabbyparas6
@gabbyparas6 Жыл бұрын
Thank you for this. Question, how can I add multiple columns?
@parranoic
@parranoic Жыл бұрын
Superb! Thank you
@damiandamian3961
@damiandamian3961 3 жыл бұрын
How do you do it with a dataverse table
@vsone9565
@vsone9565 2 жыл бұрын
Thank you for your creative solutions - truly helpful. Is it possible to use this method in a way that sums certain groups of values in an array? ex. [ { "Id": "A", "quantity": "3" }, { "Id": "A", "quantity": "3" }, { "Id": "B", "quantity": "2" } ] Where we want A - 6, B - 2
@PaulieM
@PaulieM 2 жыл бұрын
Yes, it’s possible to exactly that. I’ve done a couple of demos of this at events - but I can record a new KZbin video that shows how to do it if that would be useful
@vsone9565
@vsone9565 2 жыл бұрын
@@PaulieM That would be wonderful! No rush, was just thinking out loud - love the idea of avoiding apply to each actions wherever I can
@miltonjuliechapman8824
@miltonjuliechapman8824 Жыл бұрын
A Video on this would be so helpful. I have attempted to find a solution but have really struggled. Requirement: Each row has a catagory associated by it either via a lookup value or an option set value (Different Tables). I want to list all £ amounts and their associated lookup/option set value set via the record and then sum up based on this.
@juansepowerplatform
@juansepowerplatform 3 жыл бұрын
Great to know this. Thank you
@ThomasPublicThuene
@ThomasPublicThuene 2 жыл бұрын
Wow, that was quick.
@clausfraenkel2968
@clausfraenkel2968 2 жыл бұрын
You use this approach to sum 100.000 rows but how do you set this up with “get items” - i have problems with limit on that
@AlzD3mi4n
@AlzD3mi4n Жыл бұрын
Thank you, Paul! Your video is amazing! I wonder if there is a way to filter the information to send it to specific users, in your example, sum only the invoices from ID 1 and send it to user 1? Thank you in advance for your help!
@PaulieM
@PaulieM Жыл бұрын
Yes, you can do it in a number of different ways. The best way is to use the user ids to filter the xpath query to get all the data you need in a single action. Then you can use an apply to each on the output and email each user.
@AlzD3mi4n
@AlzD3mi4n Жыл бұрын
@@PaulieM In your example how would that be? I'm managing a table with IDs that are repeated in different rows, and I want to summarize the information in just one row with the totals of that particular ID.
@isabellapineda1679
@isabellapineda1679 Жыл бұрын
Muchas Gracias , dure mucho buscando información sobre como sumar una Columna , que no fuera con incremento que pasara por cada registro de obtener elemento, muy valioso el aporte muchas gracias
@PaulieM
@PaulieM Жыл бұрын
Thank you! I’m glad it helped you out.
@berndkretzschmar5139
@berndkretzschmar5139 2 жыл бұрын
Chapeau, it really helped.
@abcd64709
@abcd64709 Жыл бұрын
Thank you Paul. How do you set 100,000 record threshold by the way?
@PaulieM
@PaulieM Жыл бұрын
Use the “take” expression on your array, this will let you specify a number of records to extract from your array.
@jonmatthews5642
@jonmatthews5642 2 жыл бұрын
This worked a treat for me and is soooooo much quicker than an apply to each! but how can I get the min/max values? Thanks J
@aubreyprice5053
@aubreyprice5053 2 жыл бұрын
There's a function built into powerautomate you could likely use. Find the max from an output and assign it to a variable.
@Hansman
@Hansman 2 жыл бұрын
How do you do this on multiple columns on a list ? then get each sum and send it to another summary list?
@PaulieM
@PaulieM 2 жыл бұрын
You can actually do it on multiple columns simultaneously or separately. Can you tell me a bit more about your requirement and perhaps I will do a video on it.
@Hansman
@Hansman 2 жыл бұрын
@@PaulieM what I am trying to do is to sum each month of a fiscal year from multiple list which would then be categories on a summary fy list. I think I can do it like you said separately but I want to know how to do it simultaneously. I am progressing in learning power automate thanks to your videos.
@Hansman
@Hansman 2 жыл бұрын
Hi Paulie How do you sum rows using this method?
@PaulieM
@PaulieM 2 жыл бұрын
Hi Hans, can you explain a bit more about what you mean please? Do you have a row with multiple columns that you want to sum?
@Hansman
@Hansman 2 жыл бұрын
@@PaulieM yes multiple columns.
@ImuRazz
@ImuRazz 2 жыл бұрын
I have like 8 columns and how can i sum each and append it to the table?
@PaulieM
@PaulieM Жыл бұрын
You would execute multiple xpath queries in a single select action.
@ImuRazz
@ImuRazz Жыл бұрын
@@PaulieM thanks, this was very helpful.
@ronakshah6336
@ronakshah6336 Жыл бұрын
How to convert the SUM into HTML Table and share it to the email
@AlzD3mi4n
@AlzD3mi4n Жыл бұрын
You just create an action> Create HTML Table> then define the headers and the information that will be in the rows, in this case your SUM.
@Mx81
@Mx81 3 жыл бұрын
Great tip. I run into an error if there are null/blank values included. I found and tried this one, but I get an "invalid expression" error back: xpath(outputs('Compose_JSON2XML'),'sum(/root/Numbers[string(number(.)) != 'NaN'])') Do you know how to handle this? I also couldn't find a documentation about the xpath function like 'sum'. Would be great to have an overview of the possibilities ;-)
@jonmatthews5642
@jonmatthews5642 2 жыл бұрын
I had the same issue. I created a filter array to remove all the null/blanks and it worked.
@ozhally
@ozhally Жыл бұрын
even better
@Zabideen97
@Zabideen97 5 ай бұрын
I don't know how it works but it reduced my flow run time from 1 hour to just few minutes.
@PaulieM
@PaulieM 5 ай бұрын
Ha ha, that’s brilliant news! Well done!
How to group and calculate sum of Power Automate array items
24:54
Alireza Aliabadi
Рет қаралды 19 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Power Automate flow variables - How to use them
14:02
Reza Dorrani
Рет қаралды 79 М.
Use This Trick to Automate Any Excel Task (Better Than Macros)
10:53
Kenji Explains
Рет қаралды 161 М.
Power Automate Flow filter array to create summary SharePoint Data
26:23
How to: OData filter in Power Automate on Dataverse lookup field
9:01
Alireza Aliabadi
Рет қаралды 13 М.
Populate a Word Template table Dynamically with Power Automate
18:38
Use the Power Automate v2 Trigger for Power Apps
19:09
Shane Young
Рет қаралды 50 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН