# Data Modelling Layer

The Data Modelling Layer lets you define structured Salesforce data resources, accept real-time runtime variables, and apply precision controls that determine exactly what data flows into each generated document.

> Kind: Guide · Updated: Jul 30, 2026

The Data Modelling Layer shapes and controls what data enters a template using resources, runtime values, and selection logic. Before any data is rendered into a document, it passes through this layer, which structures it into reusable resources, accepts real-time inputs, and applies precise selection rules.

This is the preparation step between raw Salesforce data access and the dynamic content that ultimately appears in a generated document — turning any object or field into clean, controlled inputs a template can rely on.

## Data Resources

CloudFiles lets you define Single-Record and Record-Collection resources as structured data inputs for templates. A Single-Record resource brings in one record's fields, while a Record-Collection resource brings in a related list of records, and both act as reusable data sources within the template builder.

Shape data once and reuse it everywhere — defining resources this way gives every field, table, or loop in the template a clean, consistent input, so documents stay accurate no matter how many places a resource is used.

## Runtime Variables

Runtime Variables accept real-time values during document generation, including single-value and multi-value inputs. Instead of hardcoding a value into the template, a Runtime Variable is filled in at the moment a document is created.

Capture last-mile details instantly — Runtime Variables let a template reflect information that only exists at generation time, without ever needing to edit the template itself.

## Precision Data Controls

Precision Data Controls apply filtering, sorting, grouping, row limits, and default values before data is inserted into a template, giving you exact control over which records and values make it into the final document.

Control what appears in every document with precision — these controls produce cleaner outputs and remove the need for manual cleanup after generation.

![Diagram showing raw CRM records flowing through the Data Modelling Layer (Resources, Runtime, and Controls) into a generated Customer Summary document](https://media.help.cloudfiles.io/dg-data-modelling-layer-sf/data-modelling-layer-diagram.png)
