Is it possible to read the global `user` object from a view's XML?

I'm using the global user object in my view's JS as per: https://docs.journeyapps.com/reference/container/user-related-data

Is it possible to access this global object from my XML? I'm trying to do something like this:

<button label="Edit {user.name}" on-press="edit" style="solid"/>

The global user object is a global JS variable and needs to be accessed from JS.

So, to access it from your View XML you simply need to tell your XML to execute raw JS using the $: notation, like so ...

<button label="Edit {$:user.name}" on-press="edit" style="solid"/>
1 Like