# Data access
URL: https://docs.valsight.ai/data-access/
Description: Use this category when you want to bring uploaded or source data into node formulas, or send data to an external service and return the result to the model.
Use this category when you want to **bring uploaded or source data into node formulas**, or send data to an external service and return the result to the model.

These functions connect your model logic to data outside the formula itself.

## Start here if you want to:

* **Reference a measure** from an uploaded table
* Connect data using the **Function Editor UI**
* Send cube inputs to an **external service** and return a result cube

## Not here if you want to:

* Filter, fill, pick, or rank data after loading it → see [Filtering & data shaping](/filtering-data-shaping/)
* Reshape granularity → see [Dimensionality & hierarchies](/dimensionality-hierarchies/)

## Mental model

* `DATA` returns values from a specific data table measure
* `API_CALL` sends one or more input cubes to an external endpoint and expects a result cube in return

## Common patterns

| Name                           | What it does                                                                     | Formula                                                                                         |
| ------------------------------ | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Reference a data-table measure | Use when a node should represent a measure from uploaded or source data.         | `DATA("DataSourceName", "TableName", "MeasureName")`                                            |
| Set the unit on a DATA result  | Optional, use when you want to explicitly supply a unit.                         | `DATA("Model Data", "Gross_Sales", "Price", "EUR")`                                             |
| Use the UI to connect data     | Use the **Data** button in the Function Editor to build the `DATA` call for you. |                                                                                                 |
| Call an external service       | Use when logic or data lives outside Valsight and returns the result.            | `API_CALL("https://externalServer.com/sumTwoNodes", ['Node A', 'Node B'], ["Year", "Country"])` |

## Functions in this category

| Function                | Description                                                                                                     |
| ----------------------- | --------------------------------------------------------------------------------------------------------------- |
| [DATA](/data/)          | References a data table directly and returns its values.                                                        |
| [API\_CALL](/api-call/) | Calls an external application with an HTTP POST request to a specified URL and returns the result to the model. |

## Choosing between similar functions

**DATA vs API\_CALL**

* Use `DATA` when the values already exist in your uploaded/source tables and should be consumed directly in the model
* Use `API_CALL` when the values must be computed or retrieved externally and returned as a cube

## Pitfalls & troubleshooting

* **DATA returns empty:** verify `DataSource`, `Table`, `Measure` names match exactly
* **DATA is empty for specific slices:** check whether your model dimensions, levels and level values match the uploaded table values (name/case)
* **Units behave unexpectedly:** confirm whether you rely on measure metadata or explicitly set the optional unit parameter in `DATA`
* **API\_CALL is unavailable:** it may require enablement (for example a separate subscription or configuration)
* **API\_CALL returns an error:** ensure the response follows the expected Valsight table/cube JSON structure and includes the required result shape; otherwise Valsight can’t cast it into a node
* **API\_CALL fails due to restrictions:** check configuration limits (for example allowed URLs, payload size/row limits, and timeouts)

## Related

* [Function catalog](/function-catalog/): full signatures, parameters, and examples
* [Filtering & data shaping](/filtering-data-shaping/): select, fill, pick, rank after loading data
* [Dimensionality & hierarchies](/dimensionality-hierarchies/): make the loaded data match required output shape
