how to display userRole as dynamic data?

0
hello, i met a Problem that cannot show a dynamic data: userRole on my page: i already created 3 userRoles(admin, reqeuster & approver) both in Project security settings & module security. then i made an entity named “TeamUser” which inherited from Administration.Account. after that i created a Page & wanna it shows user information include userRole, i used “Commen widget text” to show other attributes as dynamic data on page. but i cannot find userRole attribute in selection. i tried to make an association between “System.userRole” & my “TeamUser” entity, then i can find userRole in selection & add it to then Text Widget let it show as dynamic data. but i tested the page, all other attributes show on the page fine. but UserRole shows nothing! i confused & don’t know why! because it is enum type & cannot show in Text Widget? is there someone know how to solve this problem?
asked
4 answers
1

The role can be retrieved and then put into a variable which can be displayed on the page. I am attaching image of the activity.

answered
1

For some reason, I am unable to insert image. So here is the content.

In the microflow, retrieve System.UserRole object from Database. Retrieve only First object and in XPath contraint, put [System.UserRoles = $curremtUser]

You will get UserRole object of the user who is logged in.

answered
0

Hi Yali,

As romil suggested, you can retrieve the currentuser user role using microflow as he mentioned in his comments.

There is a one more way to get it.

Create a microflow to get current user account object and create a new micorflow to retrieve the current user userrole before that just call the previously created microflow which returns the current account object.

After retrieving the userrole, Just set name of the userrole to any attribute of the entity and then use that attribute to display to the user.Please find an image below for reference.

  1. Retrieve the current user account object

            https://pasteboard.co/J6DSBwA.jpg

  1. Retrieve the currentuser userrole.

           https://pasteboard.co/J6DUq2e.jpg

answered
0

Hi Romil and Stlla,

 

i just solve my problem by using Data view grd to show UserRole instead text widget.

 

but thanks all the same for your help!

answered