The selected page Home expects a root object. It cannot be set as home page.

0
I am trying to display username on the home page. I am using authentication widgets to create login page. I want to access the username entered on the home page. As far as I understand I would need a data view and attach it to the corresponding entity to achieve the same. But I get error as mentioned in Title. How do I achieve this?
asked
1 answers
0

Hi Manish,

You can accomplish this by using a dataview with a microflow data source. 

Here is a quick example:

I added a dataview to my  homepage that has a datasource of microflow. The microflow returns an account object and inside the dataview I'm displaying the Name attribute (which is username when logging in) and I'm rendering it as text. 

 

Here is the microflow that I used for the dataview. It returns the account object, so I can display username or any other attribute from the accounts table. 

https://modelshare.mendix.com/models/2a27e93c-7865-45c4-9040-c55a094ae047/retrieve-account-object-with-inheritance

It uses the current user token to cast the Account object. 

 

Also, you can import that microflow into your project if you copy the link and press ctrl-v in your modeler. 

 

Hope this helps!

answered