cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanKorchak
Helper IV
Helper IV

Calculate total of calculated SP List column

Hi All

I am creating a flow  where I am selecting few items from SharePoint list and then I need to calculate total of calculated column of those selected items, so before "Apply to each" I make a temp number variable and in "Apply to each" I try to increment it but calculated field doesnt appear in Dynamic Content (because flow sees calculated field as a string). I cannot convert that calculated field value to number because in doesnt appear in Dynamic Content when I try to set it as parameter for expressions int() or float().

So how do I calculate that total (or use calculated field from SP List at all)?

Please do not write "It works for me" - that doesnt help.

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @RomanKorchak ,

 

You can use Compose to store the dynamic content you need to obtain, and then configure the output of Compose in expression.

Like:

73.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
efialttes
Super User
Super User

@RomanKorchak 

From my experience, flow and calculated SP List columns were not good friends.

It's a long time I do not check if calculated SP List Columns and Flow are already compatible,so also very interested to see if somebody has a way to solve this.

What I do is to apply a different approach: instead of using Calculated columns, I make Flow to be the one that do this calculation job instead, please note you need to be careful to make sure Flow calculation does not create a neverending loop because Flow shall be evaluated everytime the item changes. There were some workarounds to make this work, but last year a very useful functionality was released: trigger execution dependant on a condition, as explained here.

 

Not sure if this approach matches your requirements although

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



thanks @efialttes  , I have thought of that 
But the problem is that even number columns not appearing under Dynamic content in parameters of mul() , float() or int() .

 

@RomanKorchak 

You should be able to use SP Number columns in PowerAutomate (aka Flow) expressions. The point is: flow editor sometimes is a bit buggy 😞

You can try the following approach: add the Number column itself, hover the mouse over it, and you will see the alias given by flow to invoke it. Then write you own expression with the editor, and add the Number column alias given by Flow.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



@efialttes 

Tried that - getting "The expression is invalid" 😞 

Hi again

Can you share the expression you are trying?

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



 

image.png

 

mul("@items('Apply_to_each_Capx_Item')?['Price']",2)

 

 Hi again

Try with

mul(items('Apply_to_each_Capx_Item')?['Price'],2)

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



v-bacao-msft
Community Support
Community Support

 

Hi @RomanKorchak ,

 

You can use Compose to store the dynamic content you need to obtain, and then configure the output of Compose in expression.

Like:

73.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,760)