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 / How to do simple sums ...
Power Automate
Unanswered

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.

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    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

     

  • efialttes Profile Picture
    14,756 on at

    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

  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    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
  • Verified answer
    v-litu-msft Profile Picture
    on at

    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.

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard