---
title: TO_SNAKE_CASE
url: https://www.tines.com/docs/formulas/functions/to-snake-case/
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)*

# TO_SNAKE_CASE

*[View on tines.com](https://www.tines.com/docs/formulas/functions/to-snake-case/)*

Turn input text into snake case. When from_camel_case is true, the function will convert camel case to snake case.

**Categories:** Text

## Syntax

```
TO_SNAKE_CASE(text, [from_camel_case: false])
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "message": "Hello World!"
  }
}
```

Formula:

```
TO_SNAKE_CASE(my_action.message)
```

Output:

```json
"hello_world"
```

### Example 2

Input:

```json
{
  "my_action": {
    "message": "Testing-1 2 3"
  }
}
```

Formula:

```
TO_SNAKE_CASE(my_action.message)
```

Output:

```json
"testing_1_2_3"
```

### Example 3

Input:

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

Formula:

```
TO_SNAKE_CASE(my_action.message)
```

Output:

```json
"foobar"
```

### Example 4

Input:

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

Formula:

```
TO_SNAKE_CASE(my_action.message, from_camel_case: true)
```

Output:

```json
"foo_bar"
```

## Sample actions

```json
{
  "standardLibVersion": "14",
  "actionRuntimeVersion": "3",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "Hello World!"
        }
      },
      "position": {
        "x": 2415,
        "y": 5400
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "TO_SNAKE_CASE",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "to_snake_case": "=TO_SNAKE_CASE(my_action.message)"
        }
      },
      "position": {
        "x": 2505,
        "y": 5505
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "message": "Testing-1 2 3"
        }
      },
      "position": {
        "x": 2580,
        "y": 5400
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    },
    {
      "sourceIdentifier": 2,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
