# Variable Auto Creation

This article explains how Model Reef automatically creates and maintains variables from your Xero account mappings so that you do not need to build every line manually.

You will learn:

* When variables are auto created.
* How their type, category and branch are chosen.
* How auto created variables interact with manual modelling.
* How to override or extend their behaviour.

***

## When variables are auto created

Variables are auto created during Xero integration when:

* You have imported the Chart of Accounts and mapped accounts.
* You run an **Actuals Import** for a given date range.
* Model Reef detects that a mapped account does not yet have a corresponding variable in the model.

For each such account, Model Reef creates a new variable and links it to the Data Library series holding the imported actuals.

If a variable for that mapping already exists, Model Reef will **update** it rather than create a duplicate.

***

## How the variable settings are chosen

For each auto created variable, Model Reef uses your COA mapping to set:

* Name
  * Usually derived from the Xero account name and code, possibly sanitised.
  * You can later rename the variable without breaking the link to the Data Library series.
* Variable type
  * As chosen during COA mapping (Revenue, COGS, Opex, Staff, Asset, Liability, Equity, Tax, Dividend).
  * Determines how the variable affects P\&L, Balance Sheet and Cashflow.
* Category and subcategory
  * As mapped from the account into your reporting structure.
  * Controls where the line appears in P\&L and other reports.
* Branch
  * As chosen during branch mapping (entity, division, store, project).
  * Determines where the line appears in branch level statements and rollups.
* Units and frequency
  * Based on Xero data and import settings (typically monthly currency amounts).

These defaults give you a working set of variables that reflect your accounting structure and history.

***

## Auto created variables and manual forecasts

Once auto created, these variables are yours to work with. You can:

* Add forward looking **drivers** and formulas to extend them into the future.
* Adjust **timing and delays** if cash behaviour differs from accrual timing.
* Refine **categories** to suit reporting needs.
* Add **notes, tags and attachments** for context.

You do not need to recreate variables by hand to add forecasts. The auto created variables serve as the base.

Common patterns:

* Use imported revenue actuals as history and drive future periods with volumes and price drivers.
* Use imported expense actuals as history and drive future periods with inflation or efficiency assumptions.
* Use imported loan balances as history and build forward loan schedules.

***

## Avoiding duplicate variables

To avoid duplicates:

* Do not manually create variables that map to the same source Xero account if you intend to use auto creation.
* If you already have manual variables, either:
  * Map Xero accounts to those existing variables carefully.
  * Or accept that some imports will create new variables and then consolidate lines manually.

In general, it is simpler to let the integration auto create variables first, then edit and extend them, rather than building parallel variables with overlapping scope.

***

## Overriding auto created behaviour

You can override almost all aspects of auto created variables:

* Change the **name** to match your internal conventions.
* Adjust **type** if the initial mapping was not quite right.
* Refine **category** and **subcategory** for reporting.
* Change **branch** assignment if the line was mis allocated.
* Add or modify **timing, delays and formulas** to reflect real world behaviour.

Changes you make will persist across refreshes. When you next refresh from Xero, Model Reef will update the underlying Data Library series but will not reset your custom logic unless you explicitly remap.

***

{% hint style="info" %}
Practical tips

* Let the integration auto create variables on your first import, then tidy naming and categories in bulk.
* Use tags to mark variables that are Xero sourced versus manually created.
* Keep a short list of key variables that drive most of the P\&L and focus your forecasting work there first.
* Gradually refine auto created variables into richer models rather than trying to perfect everything in one pass.
  {% endhint %}

***

## Related articles

* [Customer-Level Revenue Modelling](/use-cases/wholesale-distribution-and-b2b-trade/customer-level-revenue-modelling.md)
* [Build a Debt Schedule & Covenants Model](/how-tos/investment-and-transactions/build-a-debt-schedule-and-covenants-model.md)
* [Variable Auto Creation](/help/xero-integration/variable-auto-creation.md)
* [Variable Editor Screen](/syntax/understanding-the-interface/variable-editor-screen.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.modelreef.io/help/xero-integration/variable-auto-creation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
