I have a datasource for my APL document:
{ "templateData": { "type": "object", "properties": { "items": [ { "premiereDate": "Wednesday, April 30, 2008", "type":"Movie", "name": "Iron Man", "index": "", "source": "https://example.com/service/Items/16318/Images/primary?quality=90&maxHeight=1008&maxWidth=700&", "id": 16318 }, { "premiereDate": "Thursday, June 12, 2008", "type":"Movie", "name": "The Incredible Hulk", "index": "", "source": "https://example.com/service/Items/16507/Images/primary?quality=90&maxHeight=1008&maxWidth=700&", "id": 16507 } ] } }
I'm trying to access my datasource info in the document "onMount" event.
I am using "SetValue" on the footer hintText to let users know the speech commands available to say. I'm cycling through the possibilities by using data from my dataSource.
Example: "Try \"Alexa, show the ${data.type} ${data.name}\""
However, when using a "Sequential" in the onMount event, I can't seem to set the "data" attribute to the datasource payload.
Is it possible to load the dataSource into a sequential command, or am I missing something? or am I completely wrong?
Note: I am using APL 1.1 (hence the use of the "payload" param on the mainTemplate object.)
My Render Document has a footer with hint text, it looks as follow (some items removed except for footer):
{ "type": "APL", "version": "1.1", "theme": "dark", "import": [ ], "resources": [ ], "onMount": [ { "commands": [ { "type": "AnimateItem", "easing": "ease-in", "duration": 1020, "componentId": "hint", "value": [ { "from": 1, "to": 0, "property": "opacity" } ], "screenLock": false, "delay": 5000 }, { "type": "SetValue", "property": "hintText", "value": "Try \"Alexa, show the ${data.type} ${data.name}\"", "componentId": "hint", "screenLock": false, "delay": 0 }, { "type": "AnimateItem", "easing": "ease-out", "duration": 1020, "componentId": "hint", "value": [ { "from": 0, "to": 1, "property": "opacity" } ], "screenLock": false, "delay": 2500 } ], "type": "Sequential", "repeatCount": 5, "data": "${payload.templateData.properties.items}" <---Not loading DataSource!! } ], "mainTemplate": { "parameters": [ "payload" ], "items": [ { "type": "Container", "items": [ { "hintText": "", "type": "AlexaFooter", "position": "absolute", "bottom": "1vh", "id": "hint", "opacity": 1, "disabled": false } ], "width": "100vw", "height": "100vh", "id": "primary", "opacity": 1, "disabled": false } ] } "commands": { } }