---
sourceDocument: Yokohama Build workflows
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/build-workflows

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Simple math transform functions

# Simple math transform functions {#ariaid-title1}

Release version: Yokohama  
Updated January 30, 2025  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Simple math transform functions

Simple math transform functions in ServiceNow Yokohama release enable you to perform basic mathematical calculations on Number data pills.
These functions require input data pills of type Array.Number, Array.Integer, or Array.Decimal.
Using the correct input type is crucial, as applying a function to an incompatible data type returns the original input without transformation during runtime.
Show full answer Show less  

## Key Functions and Their Use

* **Absolute Value:** Returns the non-negative distance of a number from zero.
* **Add:** Adds a specified value to the input number.
* **Average:** Calculates the average value of elements in an input array.
* **Count:** Counts the number of elements in an input array of various data types.
* **Divide:** Divides the input number by a specified value.
* **Max:** Finds the highest value in an input number array.
* **Median:** Finds the median value within an input number array.
* **Min:** Finds the lowest value in an input number array.
* **Multiply:** Multiplies the input number by a specified value.
* **Power:** Raises the input number to the power of a specified exponent.
* **Round:** Rounds the input number to a specified digit position based on standard rounding rules.
* **Square Root:** Computes the positive square root of a positive input number.
* **Subtract:** Subtracts a specified value from the input number.
* **Sum:** Calculates the sum of elements in an input number array.
* **To Fixed:** Truncates a decimal number to a specified number of decimal places without rounding.

## Practical Considerations

Ensure the input data pill types match the function requirements to avoid no-operation results. Parameters such as the number to add, subtract, multiply, divide, or the number of decimal places to truncate are critical for precise transformations. The functions handle arrays and single numeric inputs appropriately, returning numeric outputs that can be used in further flow processing.

## Outcome

By leveraging these simple math transform functions in ServiceNow flows, you can automate numerical calculations, aggregate data, and manipulate numeric values efficiently within your workflows. This enables streamlined data processing and reduces the need for custom scripting for common mathematical operations.  
Use simple math transform functions to perform basic mathematical calculations on
Number data pills.
Simple math transform functions require an Array.Number, Array.Integer, or Array.Decimal
input data pill. Make sure to use the correct input [data pill type](https://servicenow-prod.fluidtopics.net/ARg0hrW3U2nWpn0~NS9OnQ "Actions and subflows use variables to store input and output data. The variable data type determines what kind of data it stores and its advanced configuration options.") when applying simple math transform functions. If a simple math
transform function is applied to an improper data type, the data is not transformed at
runtime and the input value is returned instead. For more information on confirming your
flow runtime values, see [Test a flow](https://servicenow-prod.fluidtopics.net/JuEt3LRi35Ryvy35xOI3DA "Before activating a flow so other users can access it, test to make certain it works the way you expect.").

## Absolute Value {#simple-math-transform-functions__section_ltc_q2y_3nb}

A mathematical function that returns the distance from zero for any real number. An
absolute value is always a positive or zero value.  
{#simple-math-transform-functions__table_j3p_rbw_knb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Number, Integer, or Decimal | Number as the absolute value of the input number |
[ ]

{#simple-math-transform-functions__table_j3p_rbw_knb}  
Figure 1. Example

* Input: `-3`
* Output: `3`
{#simple-math-transform-functions__ul_u3f_1hy_3nb}

## Add {#simple-math-transform-functions__section_ug1_2n4_mpb}

Adds the given value to the input.  
{#simple-math-transform-functions__table_rfg_qn4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number to be added. | Number as the addition of the input value by the parameter. |
[ ]

{#simple-math-transform-functions__table_rfg_qn4_mpb}  
Figure 2. Example

* Input: `12`
* Parameter: `4`
* Output: `16`
{#simple-math-transform-functions__ul_wgr_c44_mpb}

## Average {#simple-math-transform-functions__section_d2g_2n4_mpb}

Returns the average value of the elements in the input array.  
{#simple-math-transform-functions__table_wms_444_mpb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, or Array.Decimal | Number as the average value of the input array. |
[ ]

{#simple-math-transform-functions__table_wms_444_mpb}  
Figure 3. Example

* Input: `[10, 30, 20]`
* Output: `20`
{#simple-math-transform-functions__ul_wml_t44_mpb}

## Count {#simple-math-transform-functions__section_owd_cy4_mpb}

Returns the number of elements in the input array.  
{#simple-math-transform-functions__table_o3k_gy4_mpb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, Array.Decimal, Array.Object, Array.String, or Array.Boolean | Number of elements in the input array |
[ ]

{#simple-math-transform-functions__table_o3k_gy4_mpb}  
Figure 4. Example

* Input: `[2, 10, 30]`
* Output: `3`
{#simple-math-transform-functions__ul_qh5_jy4_mpb}

## Divide {#simple-math-transform-functions__section_a1q_2n4_mpb}

Divides the input value by a given value.  
{#simple-math-transform-functions__table_jlw_y44_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number to divide the input value by. | Number as the division of the input value by the parameter. |
[ ]

{#simple-math-transform-functions__table_jlw_y44_mpb}  
Figure 5. Example

* Input: `12`
* Parameter: `4`
* Output: `3`
{#simple-math-transform-functions__ul_cqg_gp4_mpb}

## Max {#simple-math-transform-functions__section_z4d_2pz_jjb}

Returns the highest value found in the input Array.  
{#simple-math-transform-functions__table_pl3_lbg_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, or Array.Decimal | Number as the highest value in the input Array |
[ ]

{#simple-math-transform-functions__table_pl3_lbg_mkb}  
Figure 6. Example

* Input: `[1, -5, 20, 6]`
* Output: `20`
{#simple-math-transform-functions__ul_zyf_gqz_jjb}

## Median {#simple-math-transform-functions__section_mhr_fn4_mpb}

Returns the median value of elements in the input array.  
{#simple-math-transform-functions__table_tzv_lp4_mpb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, or Array.Decimal | Number as the median value of the input array. |
[ ]

{#simple-math-transform-functions__table_tzv_lp4_mpb} Figure 7. Example

* Input: `[10, 30, 15]`
* Output: `15`
{#simple-math-transform-functions__ul_rhv_rp4_mpb}

## Min {#simple-math-transform-functions__section_qkv_nrz_jjb}

Returns the lowest value found in the input Array.  
{#simple-math-transform-functions__table_trv_pbg_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, or Array.Decimal | Number as the lowest value in the input Array |
[ ]

{#simple-math-transform-functions__table_trv_pbg_mkb}  
Figure 8. Example

* Input: `[1, -5, 20, 6]`
* Output: `-5`
{#simple-math-transform-functions__ul_tkv_nrz_jjb}

## Multiply {#simple-math-transform-functions__section_v3d_gn4_mpb}

Multiplies the input value by a given value.  
{#simple-math-transform-functions__table_xqq_wp4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number to be multiplied. | Number as multiplication of the input value by the parameter. |
[ ]

{#simple-math-transform-functions__table_xqq_wp4_mpb}  
Figure 9. Example

* Input: `12`
* Parameter: `4`
* Output: `48`
{#simple-math-transform-functions__ul_ulq_bq4_mpb}

## Power {#simple-math-transform-functions__section_tmn_gn4_mpb}

Returns the value of the input value raised to the power of a given value.  
{#simple-math-transform-functions__table_z2c_gq4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number as the exponent of the power. | Number as the power of input value to the parameter. |
[ ]

{#simple-math-transform-functions__table_z2c_gq4_mpb}  
Figure 10. Example

* Input: `2`
* Parameter: `3`
* Output: `8`
{#simple-math-transform-functions__ul_h2m_kq4_mpb}

## Round {#simple-math-transform-functions__section_mnt_y2y_3nb}

A mathematical function that approximates a numeric value based on rounding rules and a
digit position. The function rounds up by adding one to the digit to be rounded and then
replacing all digits to its right with zeroes.  
{#simple-math-transform-functions__table_qgh_g2w_knb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number of Digits - A positive integer specifying the position of the digit to be rounded starting on the left | Number as the rounded value of the input number |
[ ]

{#simple-math-transform-functions__table_qgh_g2w_knb}  
Figure 11. Example

* Input: `194`
* Parameter: `2`
* Output: `190`
{#simple-math-transform-functions__ul_zys_2hy_3nb}  
Note:  
The function uses the digit to the right of the parameter digit to round up or down. If the digit to the right has a value from zero through four, the function rounds down. If the digit to the right has a value from five through nine, then the function rounds up. If there is no digit to the right, then the function rounds down.

## Square Root {#simple-math-transform-functions__section_vd2_z2y_3nb}

A mathematical function that computes a positive number that when multiplied by itself
produces the input value. The input value must be a positive real number.  
{#simple-math-transform-functions__table_nyq_ndw_knb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Number, Integer, or Decimal | Number as the square root of the input number |
[ ]

{#simple-math-transform-functions__table_nyq_ndw_knb}  
Figure 12. Example

* Input: `16`
* Output: `4`
{#simple-math-transform-functions__ul_ibw_ghy_3nb}

## Subtract {#simple-math-transform-functions__section_efg_hn4_mpb}

Subtracts the given value from the input.  
{#simple-math-transform-functions__table_tpy_4q4_mpb__entry__3}

| Input data pill | Parameters | Output data pill |
|-|-|-|
| Number, Integer, or Decimal | Number to subtract from the input value. | Number as the subtraction of the input value by the parameter. |
[ ]

{#simple-math-transform-functions__table_tpy_4q4_mpb}  
Figure 13. Example

* Input: `12`
* Parameter: `4`
* Output: `8`
{#simple-math-transform-functions__ul_umk_tq4_mpb}

## Sum {#simple-math-transform-functions__section_yv3_qrz_jjb}

Returns the sum of all values in the input Array.  
{#simple-math-transform-functions__table_m2k_tbg_mkb__entry__2}

| Input data pill | Output data pill |
|-|-|
| Array.Number, Array.Integer, or Array.Decimal | Number as a sum of all values in the input Array |
[ ]

{#simple-math-transform-functions__table_m2k_tbg_mkb}  
Figure 14. Example

* Input: `[1, -5, 20, 6]`
* Output: `22`
{#simple-math-transform-functions__ul_bw3_qrz_jjb}

## To Fixed {#simple-math-transform-functions__section_xcf_1hk_hrb}

Truncates a floating number to the specified number of decimal places.
{#simple-math-transform-functions__table_g4y_chk_hrb__entry__3}

| Input data pill | Parameter | Output data pill |
|-|-|-|
| Number - Decimal number before truncation. | Number of Digits - Number that specifies the number of decimal places to truncate. | Number - Decimal number after truncation. |
[ ]

{#simple-math-transform-functions__table_g4y_chk_hrb} Figure 15. Example

* Input: `1.93456`
* Parameter: `2`
* Output: `1.93`
{#simple-math-transform-functions__ul_tpf_whk_hrb}

