Data Sources and Data Binding
Alexa Presentation Language (APL) supports data-binding, which lets your document retrieve data from a separate data source that you provide. Use data binding to separate your presentation logic (the APL document) from your source data.
See the topics in this section for details about defining data sources and binding data.
A data source is a JSON structure that defines data you can bind to an Alexa Presentation Language (APL) document. When you send an APL document to Alexa with the
RenderDocument directive, you can include one or more data sources.
For details about how to define and use a data source, see Data Sources.
A transformer converts data in data source into an alternative representation. For example, the
ssmlToSpeech transformer converts a string marked up with SSML into speech that you can invoke in your document.
For details about how use transformers, see Transformers.
APL documents rely on data-binding to incorporate user-provided data, include styles and other visual resources, pass parameters into layouts, and conditionally inflate layouts based on data. The data-binding context is the collection of data sources and data available to an APL document for data binding.
For details about how data-binding works and the information available in the data-binding context, see Data-Binding Evaluation.
You use data-binding syntax to write expressions that Alexa evaluates when displaying your document. For a reference to the syntax for these expressions, see Data-Binding Syntax.
Viewport Object in the Data-Binding Context
The data-binding context includes a
viewport property that describes the operating characteristics of the display device. For a reference to the properties in this object, see Viewport Object in the Data-Binding Context.