Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

How to do simple sums with variable values?

(0) ShareShare
ReportReport
Posted on by

So I have a flow to analyse results from a quiz on MS FORMs.

 

I've got variables set up for the number of questions and the score.  I want to email the person with their results and their percentage score.

 

I cannot figure out how to multiply or divide the values held within the variables so I have a percentage.

 

I may be going about this in completely the wrong way if so let me know.

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: How to do simple sums with variable values?

    Hi @Anonymous,

     

    You could initialize an integer variable named Score, then create multiple conditions to increase the Score by using the Increment variable action if the answer is correct, here I have 4 questions, so it has 4 conditions.

    Annotation 2020-04-17 111222.png

     

    Annotation 2020-04-17 111246.png

    Then use the expression to divide the Score and Total score, then convert it into a percentage, my total score is 100, for example:

    concat(string(mul(div(float(variables('Score')),float(100)),100)),'%')

     

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

  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on at
    Re: How to do simple sums with variable values?

    Hi @Anonymous ,

     

    You can use mul(), div() and other available functions to perform math operation. i would like to see what are doing to help you further.

    i would suggest you to use compose action to perform there operations with your variable.

    Like following expression multiple my variable with 10.

    mul(10,variables('MyVar'))
     
    Thanks
  • efialttes Profile Picture
    14,756 on at
    Re: How to do simple sums with variable values?

    Hi!

    you have initialized variables of type either integer or float, right?

    All you need to use is to work with math WDL functions by means of expressions

     

    math WDL functions documented here:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#math-functions

     

    How to add expressions explained here:

    https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

    Hope this helps

  • fchopo Profile Picture
    7,972 Super User 2025 Season 1 on at
    Re: How to do simple sums with variable values?

    Hello @Anonymous 

    Please, have a look at the following threads:

    You can also have a look at math functions reference guide: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

    Hope it helps!

    Ferran

     

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1