How to Save and Clone Visual Assets in the Alexa Presentation Language (APL) Authoring Tool

Catherine Gao Dec 12, 2019
Share:
Tips & Tools Multimodal News Alexa Skills Kit
Blog_Header_Post_Img

Starting today, you can save and clone your Alexa Presentation Language (APL) documents in the authoring tool. In the past, saving your work required copying and pasting your JSON into a text editor of your choice. Now, you can create, save, edit, delete, clone, and download your visual assets in the APL authoring tool for a single skill, without even leaving your web browser. This simplifies the process of creating visuals with APL and makes collaborating with visual designers and others easier. In order to use a saved document within your skill code, keep in mind that the APL document must still be exported and added to your skill’s Lambda function or web service code. You can use the new save and clone features on all custom skills and Alexa-hosted skills. Learn more here.

Get Started with Building an APL Document

To get started with building a multimodal skill, make sure that you configure your skill to support the Alexa.Presentation.APL interface. Navigate to the APL authoring tool to see a number of different templates you can use. You will be prompted with a pop up that asks if you would like to use the new experience. Select “Yes” if so.

Screenshot of the new APL Authoring Tool experience that allows you to save your APL templates and link them to your skill for later use.
How to Save your APL Document

You can start from scratch or use an existing sample template to create a new APL document. Click on “Save Template” in the upper-right corner to enter a name for the document. The template name is the name associated with the template in the authoring tool. If your document is not already associated with a skill, you need to also select the skill it should be associated with from the drop-down list. 

Screenshot of new APL Authoring Tool's template name pop up after you click Save Template

Once you’ve saved the document, you’ll be able to view it on the Saved Templates page.

Screenshot of new APL Authoring Tool's saved templates page within a single skill
How to Edit your APL Document

When you’re ready to edit your APL document, you can open a previously saved template by opening the skill where you saved it. Click on “Display”, and in the list of documents, find the document to open and click “Edit”. 

Screenshot of new APL Authoring Tool's saved templates page with an orange arrow pointing to "Edit"
How to Clone your APL Document

You can also click on “Clone” to clone a template in the same skill by giving it a different name or associating the template with a different skill.

Screenshot of new APL Authoring Tool's template name pop up after you click "Clone"
Use the APL RenderDocument Directive

In your skill code, you can use the Alexa.Presentation.APL.RenderDocument directive to display your document on the screen. You must add your APL document to your skill’s Lambda function or web service code and use the RenderDocument directive to display your visual content on a device with a screen. You cannot use the name of the saved template in the authoring tool.

We also recommend that you use data binding to set text, image sources, and video source values to data sources instead of hard coding them into your saved APL documents, helping you to make your templates resusable and avoid storing sensitive data.

As always, feel free to ask questions in the ASK Developer Forums