Skip to main content
Nintex Community Menu Bar

Summing Variables: Summing 28 Variables with a Function

  • July 19, 2022
  • 2 replies
  • 41 views
  • Translate

Underdog

Good morning everyone,

I have 28 variables that I would like to add together to get a total amount.  Would anyone know how to do that with a Function?  Otherwise, I could go the long way and perform "Do Calculation[s]" functions multiple times.

Thank you for your thoughts and time.

 

Did this topic help you find an answer to your question?

2 replies

Garrett
Forum|alt.badge.img+16
  • Scout
  • 904 replies
  • July 19, 2022

Hi @Underdog 

 

1. Use a Web Service such as math.js web service

The site has some caveat - The duration per evaluation of this free service is limited to 10 seconds, with a maximum of 10,000 requests per day.

 

Let's say we want to calculate "1+2+3+4+5+6+7+8+9+10"

TIP: There is a Try it where you can enter your math expression and it will generate the URL

TIP: the '+' symbol converts to '%2B

 

STEP 1: Generate the Math Expression using the Build String action.

Put all the 28 values. Save to a strExpression

 

STEP 2: Replace '+' symbol with '%2B' using Replace Substring in String action.

Step 3: Configure the Call HTTP Web Service action

Address: http://api.mathjs.org/v4/?expr={Variable:strExpression} 

For this example, I used http://api.mathjs.org/v4/?expr=1%2B2%2B3%2B4%2B5%2B6

which is 1+2+3+4+5+6

 

Step 4: Run

If everything is configured correctly, it returns (using the Log)

Log to History 

Response Content returns 21

 

 

Cheers

Translate

MillaZ
Nintex Employee
Forum|alt.badge.img+21
  • Nintex Employee
  • 671 replies
  • July 26, 2022

Please remember to mark posts as solutions if your question was solved! 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings