Skip to main content

Workbox blog

Go Search
Workbox blog
Workbox home page
  

Other Blogs
There are no items in this list.
Workbox blog > Posts > How to calculate a value in Workbox?
How to calculate a value in Workbox?

As you may have noticed, inputting "3+5" in the activity parameter will return "3+5". What to do, to receive (in this case) "8"?

To perform the calculation you need to pass the equation to a variable using "set variable" activity. NOTE: The variable which will receive the equation must be of "double" type. Only then the calculations will be performed.

Later, you can use this variable in other lookup fields.

So, for example - you want to take data from one SharePoint item field, subtract it from another field and put the equation result into another SharePoint item field. To do this:

  • create a variable of "double" type
  • in action, go to activities window
  • add "Set variable" activity and double click it to enter the details
  • Click on the value textbox, new window will appear
  • Pick (using lookups) value of the selected SharePoint item field
  • enter minus sign
  • The equation should look like this (without quotation marks) "[list_name - field_name] - [list_name2 - field_name2]"
  • Click ok, and then in the variable field select the variable created in first step
  • Close the "set variable" activity window
  • In the activities window add "edit item" activity and double click it to enter the details
  • Pick the list, filters and field you want to add the new value. In the value field pick the variable from the lookup.

You can use the following functions:

  • ^
  • +
  • -
  • /
  • *
  • cos
  • sin
  • exp
  • ln
  • tan
  • acos
  • asin
  • atan
  • cosh
  • sinh
  • tanh
  • sqrt
  • cotan
  • fpart
  • acotan
  • round
  • ceil
  • floor
  • fac
  • sfac
  • abs
  • log
  • %
  • &&
  • ==
  • !=
  • ||
  • !
  • >=
  • <=

and constants:

  • euler
  • pi
  • nan
  • infinity
  • true
  • false

Comments

There are no comments yet for this post.

Title


Body *


I'm not bot *


Enter anything
Attachments
If you can't read this number refresh your screen.
Enter the code shown above: *

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)