# Random Helper

The Random Helper allows you to generate random values

## Random Helpers overview

The Random Helper connector allows you to generate random values.

## Operations

## Random hex

This operation can be used to generate a random hex value:
![random-hex](https://tray.ai/documentation/images/connectors/helper/random-helper/5vitHq0V2pLRE2u3wL9ZHw_random-hex.png)

### Sample input payload

```json
\{
  "hex_length": 16
\}
```

### Sample output payload

```json
\{
  "result": "e02902253bda43f4"
\}
```

## Random item

This operation can be used to select a random item from a list - e.g. to select a random sales rep id to randomly allocate a prospect to a sales rep:
![random-item](https://tray.ai/documentation/images/connectors/helper/random-helper/2PA7kQfgDzoCI63RAQMyWs_random-item.png)

### Sample input payload

```json
\{
  "list": [
    "377406e34d574606",
    "5eba8adb513646e6",
    "3c694c074e364b08",
    "8f7d7c39b57141d1",
    "8b7f12174c7f4c91",
    "6ba830688ba54c9d",
    "aba7e48de1d1448d",
    "dc2bf8c56e96476c",
    "7ec8dc801a5f4916",
    "f7b2676f01d547ea"
  ]
\}
```

### Sample output payload

```json
\{
  "result": "dc2bf8c56e96476c"
\}
```

## Random number

This operation can be used to generate a random number. You can specify if it is to be returned as a string or integer, as well as the smallest and biggest values:
![random-number](https://tray.ai/documentation/images/connectors/helper/random-helper/17fPOwZFXBRblSTSLQJKiW_random-number.png)

### Sample input payload

```json
\{
  "integer": true,
  "smallest": 1000,
  "biggest": 9999
\}
```

### Sample output payload

\&#123;
"result": 6127
\&#125;

## Random property

This operation can be used to randomly select a key/value pair from an object. This is useful in cases where a list of options is presented within an object rather than an array:
![random-property](https://tray.ai/documentation/images/connectors/helper/random-helper/4ZtSk6EhDEzoISxl0nAwli_random-property.png)

### Sample input payload

```json
\{
  "object": \{
    "PROMO10": \{
      "discount": "10%",
      "description": "Get 10% off your next purchase"
    \},
    "PROMO15": \{
      "discount": "15%",
      "description": "Save 15% on orders over $100"
    \},
    "FREESHIP": \{
      "discount": "Free Shipping",
      "description": "Enjoy free shipping on all orders"
    \},
    "BOGO": \{
      "discount": "Buy One Get One",
      "description": "Buy one item, get another item free"
    \}
  \}
\}
```

### Sample output payload

```json
\{
  "key": "BOGO",
  "value": \{
    "discount": "Buy One Get One",
    "description": "Buy one item, get another item free"
  \}
\}
```

## Random string

This operation can be used to generate a random string.
You can specify `characters_set` `minimum_length` and `maximum_length`:
![random-string](https://tray.ai/documentation/images/connectors/helper/random-helper/7qOzXw0a1CrNFL4pnukF2L_random-string.png)

### Sample input payload

```json
\{
  "minimum_length": 10,
  "maximum_length": 10,
  "characters_set": "qwertyuiopasdfghjklzxcvbnm0123456789"
\}
```

### Sample output payload

\&#123;
"result": "tlezi1f9vg"
\&#125;

## Random UUID

This operation can be used to generate a random UUID:
![random-uuid](https://tray.ai/documentation/images/connectors/helper/random-helper/5VzploaXEsGmVetoFNO0Wp_random-uuid.png)
It requires no inputs and returns a random UUI in the output payload e.g.:
`{"result": "4d2c9489-9628-4bce-ad96-df0f3cde102e"}`
