PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Modulo

Returns the remainder of dividing one whole number by another.

Modulo divides the first whole number by the second and gives you what is left over. Use it to find even and odd numbers (remainder of dividing by 2), to act on every N-th item in a loop, or to spread items across a fixed number of groups.

Add the action

In the Process Designer toolbox, open Numerical and pick Modulo (or type Modulo in the search box).

The Modulo action properties: First number, Second number and Result

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
First numberInputIntegerYesThe number to divide.
Second numberInputIntegerYesThe number to divide by. Cannot be 0.
ResultOutputIntegerYesThe remainder.

Example

First numberSecond numberResult
1752
-175-2
17-52
170step fails: Divisor cannot be 0.

Good to know

  • Whole numbers only. A decimal such as 17.5 stops the step with an error.
  • The remainder takes the sign of the first number: -17 modulo 5 is -2, not 3. If you need a result that is never negative, add the second number to a negative result.
  • A number is even when Result is 0 for a Second number of 2.

On this page