---
title: DEFAULT
url: https://www.tines.com/docs/formulas/functions/default/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/docs/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# DEFAULT

*[View on tines.com](https://www.tines.com/docs/formulas/functions/default/)*

Allows you to specify a fallback in case a value doesn’t exist.

Returns the fallback value if the input is `null`, `false`, or an empty text value, array, or object. When every argument is empty, the first fallback is returned by default. Pass `{use_last_fallback: TRUE}` as the final argument to return the last fallback instead.

**Categories:** Logic, Arrays, Text

## Syntax

```
DEFAULT(value, fallback1, fallback2, ..., [{use_last_fallback: FALSE}])
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": []
  }
}
```

Formula:

```
DEFAULT(my_action.message, "fallback")
```

Output:

```json
"fallback"
```

### Example 2

Input:

```json
{
  "my_action": {
    "message": [
      1
    ]
  }
}
```

Formula:

```
DEFAULT(my_action.message, "fallback")
```

Output:

```json
[
  1
]
```

### Example 3

Input:

```json
{
  "my_action": {
    "message": ""
  }
}
```

Formula:

```
DEFAULT(my_action.message, "fallback")
```

Output:

```json
"fallback"
```

### Example 4

Input:

```json
{
  "my_action": {
    "message": "hello world"
  }
}
```

Formula:

```
DEFAULT(my_action.message, "fallback")
```

Output:

```json
"hello world"
```

### Example 5

Input:

```json
{
  "my_action": {
    "message": "hello world"
  }
}
```

Formula:

```
DEFAULT(my_action.does_not_exist, "fallback")
```

Output:

```json
"fallback"
```

### Example 6

Input:

```json
{
  "my_action": {
    "message": false
  }
}
```

Formula:

```
DEFAULT(my_action.message, "fallback")
```

Output:

```json
"fallback"
```

### Example 7

Input:

```json
{
  "my_action": {
    "message": [],
    "fallback": ""
  }
}
```

Formula:

```
DEFAULT(my_action.message, my_action.fallback, "fallback")
```

Output:

```json
"fallback"
```

### Example 8

Input:

```json
{
  "my_action": {
    "message": [],
    "first_ref": null,
    "second_ref": []
  }
}
```

Formula:

```
DEFAULT(my_action.message, my_action.first_ref, my_action.second_ref)
```

Output:

```json
null
```

### Example 9

Input:

```json
{
  "my_action": {
    "message": [],
    "first_ref": null,
    "second_ref": []
  }
}
```

Formula:

```
DEFAULT(my_action.message, my_action.first_ref, my_action.second_ref, {use_last_fallback: TRUE})
```

Output:

```json
[]
```

## Sample actions

```json
{
  "standardLibVersion": "12",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "example": "A valuable is present"
        }
      },
      "position": {
        "x": 435,
        "y": 300
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "DEFAULT",
      "description": "If the response is empty, then it will go based on your hard-coded value, in this case 'if not'.",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "default": "=DEFAULT(my_action.example, 'if not')"
        }
      },
      "position": {
        "x": 435,
        "y": 420
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "This example is missing a value to show the different result.",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "example": ""
        }
      },
      "position": {
        "x": 585,
        "y": 300
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    },
    {
      "sourceIdentifier": 2,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
