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.
Data sources
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.
Transformers
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.
Data-binding evaluation
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.
Data-binding syntax
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.
Related topics
Last updated: Nov 28, 2023