---
schema_version: "1"
id: e37ac06e4c6cf078b59672b6ced8e0b763c9a01fa6465a3d47f44c5d7a45fbf3
title: randomInt
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.6/dw-core-functions-randomint.md
canonical_url: https://docs.mulesoft.com/dataweave/2.6/dw-core-functions-randomint
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 89a1499604ce0b03bcfab71ca5fb51c8c257c4ec36cab555e20c1c671f6b7bce
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
---
product: DataWeave
version: 2.6
---

# randomInt

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## randomInt(upperBound: Number): Number

Returns a pseudo-random whole number from `0` to the specified number (exclusive).

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>upperBound</code></p></td><td><p>A number that sets the upper bound of the random number.</p></td></tr></tbody></table>

### Example

This example returns an integer from 0 to 1000 (exclusive).

#### Source

```DataWeave
%dw 2.0
output application/json
---
{ price: randomInt(1000) }
```

#### Output

```JSON
{ "price": 442.0 }
```
