> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xano.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

### <Icon icon="https://mintcdn.com/xano-997cb9ee/aZQYcxhIvSDTNEim/images/icons/xs_temp.svg?fit=max&auto=format&n=aZQYcxhIvSDTNEim&q=85&s=6e05b86a660544b2d6040353bd8faac8" size={46} width="371" height="137" data-path="images/icons/xs_temp.svg" /> Create Variable

```javascript theme={null}
var variableName {
  value = "Hello world"
}
```

<table>
  <thead>
    <tr>
      <th>Parameter</th>
      <th>Purpose</th>
      <th>Example</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>variableName</td>
      <td>This is the name of the variable you want to create.</td>
      <td>variableName</td>
    </tr>

    <tr>
      <td>value</td>
      <td>This is what you want to store in the variable. For complex data types like arrays or objects, make sure to include a json\_decode filter.</td>

      <td>
        ```javascript theme={null}
        value = "Hello world"
        value = 1234
        value = "[1,2,3,4,5]"|json_decode
        ```
      </td>
    </tr>
  </tbody>
</table>

<Accordion title="Example">
  ```javascript theme={null}
  var variableName {
    value = "Hello world"
  }
  ```

  <img src="https://mintcdn.com/xano-997cb9ee/tjSJ_pOzk8E0WRhF/images/c2d7fd93-image.jpeg?fit=max&auto=format&n=tjSJ_pOzk8E0WRhF&q=85&s=672c2ae26ee46461cb8c01f3313e2f01" alt="" width="463" height="40" data-path="images/c2d7fd93-image.jpeg" />
</Accordion>

### <Icon icon="https://mintcdn.com/xano-997cb9ee/aZQYcxhIvSDTNEim/images/icons/xs_temp.svg?fit=max&auto=format&n=aZQYcxhIvSDTNEim&q=85&s=6e05b86a660544b2d6040353bd8faac8" size={46} width="371" height="137" data-path="images/icons/xs_temp.svg" /> Update Variable

```javascript theme={null}
var.update $variableName {
  value = "Goodbye world"
}
```

<table>
  <thead>
    <tr>
      <th>Parameter</th>
      <th>Purpose</th>
      <th>Example</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>\$variableName</td>
      <td>This is the name of the variable you want to update. </td>
      <td>\$variableName</td>
    </tr>

    <tr>
      <td>value</td>
      <td>This is what you want to store in the variable. For complex data types like arrays or objects, make sure to include a json\_decode filter.</td>

      <td>
        ```javascript theme={null}
        value = "Hello world"
        value = 1234
        value = "[1,2,3,4,5]"|json_decode
        ```
      </td>
    </tr>
  </tbody>
</table>

<Accordion title="Example">
  ```javascript theme={null}
  var.update $variableName {
    value = "Goodbye world"
  }
  ```

  <img src="https://mintcdn.com/xano-997cb9ee/nsvdyKK4Dg7VUAZs/images/96fe2741-image.jpeg?fit=max&auto=format&n=nsvdyKK4Dg7VUAZs&q=85&s=ab828fbc1901d8259043c5f2ec4c64f0" alt="" width="465" height="41" data-path="images/96fe2741-image.jpeg" />
</Accordion>
