Compute Module
  • 15 Jul 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Compute Module

  • Dark
    Light
  • PDF

Article summary


The Compute module is used to increment, decrement, or assign a value to a predefined Ushur variable. For example, the Compute module can take a user response and update existing data (i.e. changing a user’s address).


Sample Application of the Compute Module

If you have a scenario where you want to approve or deny a claim based on specific criteria or if you want to calculate the percentage amount of a value, the computation can be specified in some of the following ways:

  • When assigning a value to a tag: - ClaimStatus = ‘Approved’ or ClaimStatus = ‘Declined’

  • When assigning a value to a tag from another tag: ClaimStatus = ClaimStatus

  • Using an operation such as increment, decrement, multiply: VacationDays = VacationDays + 10, or Percent = Amount % 10


Configuring the Compute Module

  1. Drag-drop or double-click the Compute module into the Inspector Panel and double-click to configure. Each compute specification can be saved as Compute Blocks. Each compute block can also be saved and assigned to a tag, which you can use later.

  2. Enter the initial value for the computation in the Starting value field.

  3. Choose an appropriate operation from the Operation dropdown menu. The available operations depend on the data type of the starting value.

    1. For General Data Types:

      • Increment [ + ]: Increases a numeric value by a specified amount.

      • Decrement [ - ]: Decreases a numeric value by a specified amount.

      • Multiply [ × ]: Multiplies a numeric value by a specified factor.

      • Divide [ ÷ ]: Divides a numeric value by a specified divisor.

      • Equals [ = ]: Sets a value equal to another value.

    2. For JSON Data Types:

      • Add Key: Adds a new key-value pair to a JSON object.

      • Update Key: Updates the value of an existing key in a JSON object.

      • Remove Key: Removes a key from a JSON object.

      • Push-Key: Appends a new value to an array within a JSON object.

  4. Provide the value to be used in the operation in the With value field.

  5. Specify the tag where the output of the compute block will be saved in the Save output to the dropdown menu. or click New Tag to save this compute block.

  6. Click Add another compute block, if you wish to configure another block. As a best practice, Ushur recommends limiting the number of compute blocks to a maximum of 10.


Once users execute a workflow with a Compute module in Ushur Studio, the Activity Summary will display a concise status of the Compute module's actions in Campaign Analytics.

Users will see:

Compute Module Status: A brief status indicating the successful execution of the Compute module.

To access specific details about the calculations made by the module, users can choose to expand the module section. Upon expansion, the following information will be displayed:

Compute Block Details: Each compute block within the module, including:

  • Starting Value

  • Operation performed

  • Value used in the operation

  • Output tag where the result was saved



Was this article helpful?