Experience dashboards context



I could use some tips on setting dashboard contexts for an experience user page load.

At the moment, what I am doing is getting the device information for users devices along with the rest of the data passed to the page load in my workflow, and the the dashboard view is set up with the context {{ data.devices.[0].deviceId }}, but I am not getting it to load the correct device.

Am I doing it wrong?

My (slightly anonymized) debug from the endpoint reply:

> "time":Thu Nov 16 2017 09:03:36 GMT+0100
> ▶"data":{} 9 keys
> "path":"/dashboard"
> "params":{} 0 keys
> "method":"get"
> ▶"headers":{} 10 keys
> "query":{} 0 keys
> "body":null
> ▶"cookies":{} 1 key
> "replyId":"5a0824e258025a00072bXXXXXXXXXXXXXXXXXXXXXXXXX"
> ▶"devices":[] 2 items
>     ▶0:{} 10 keys
>     "name":"24003a0015473532XXXXXXXX"
>     ▶"tags":{} 4 keys
>     ▶"attributes":[] 85 items
>     "deviceClass":"floating"
>     "applicationId":"59eb0f192e6af600XXXXXXXX"
>     "creationDate":Sat Nov 11 2017 10:44:02 GMT+0100
>     "lastUpdated":Mon Nov 13 2017 10:22:05 GMT+0100
>     "deviceId":"5a06c66291476600XXXXXXXX"
>     "id":"5a06c66291476600XXXXXXXX"

My workflow looks like this:



It looks like devices is not under the data property, which means the template may just need changed to {{ devices.[0].deviceId }}.


Oooh, brilliant, that put me on the right track!

Turns out I had been putting in that context pointer about 50 times with a spelling error, a bit more fiddling and I got it working:D


I had a typo in my previous reply. Inside a page template, the workflow payload is placed on the pageData property, so your template would be {{ pageData.devices.[0].deviceId }}.

More details here: https://docs.losant.com/experiences/views/#referencing-context


Yeah, once you mentioned the template, I found the right context by using the render log on the page edit screen, I hadn’t noticed that previously:)


@Preben_Dyrholm I need to dig in and work on learning this new Experience Dashboard feature set.

Sounds like you are gathering the new user info, device ID, and other data on the signup page, right?

How is that working out?

Can you share a screenshot of the page your gathering this info from so I can get an idea of what’s possible?

I’m designing a signup page for a product that will have a dashboard that displays system status info. I’m going to need to ideally capture quite a few data points during the signup process for a new client and it sounds like your doing something similar.


Hi RWB, sorry for the late reply - I’ve actually yet to build that part I’m afraid, but will post something as soon as I do - what I do at the moment is simply to create a new device if a state command is received from Particle with a device ID that doesn’t match any current device. (I do a tag query for the Get Matching Devices, then in the check devices I check that {{ device_to_update }} !== null) I then assign it manually to the user.

The plan is to do this on user registration, either through an app, or through the web portal (denying creation of new user without a matching device ID already collected).

The workflow currently looks like this, just in case it gives you any ideas:


Thanks for the explanation and screenshot.

It does help me understand better what you’re doing.

Please do post more as you progress further.