change user role display on a grid

1
i have a datagrid that i am using to gather user roles, i’d like to change the way the user role is displayed without altering the description (i use the description on another page) i’d like to replace the underscore with a space, but i’m not sure how to do this. i tried in a microflow using the account as a parameter but i am unable to select the user role as an object.
asked
6 answers
1

Hi Corina,

Since you are using Data Grid 2, you could also use Dynamic Text or Custom Content as column option.

In here you can use the following expression or something quite similar:

replaceAll($currentObject/Description,’_’,’ ‘)

answered
4

Hi,

Use replaceall function like ReplaceAll($iteratoruserrole/name,'_',' ') in DS microflow of the list view.

answered
0

Hi Corina Lopez,

 

You may use this below logic to get userrole name. I the create variable use $iteratoruserrole/name.

After getting the role name you may use replace function to achieve your requirement.

 

Regards,

Cyril 

answered
0

Hi Corina, 

As Davy Heutmekers said, you can use the DataGrid2 column configuration to setup a dynamic text from an expression where you replace the underscore, this is how:

Open the DataGrid2 settings, then open the Role column’s settings, set the Role Column’s Show attribute to “Dynamic Text”, this will unhide additional fields where you can add dynamic text using an expression. Click on the “Edit...” next to the “Dynamic Text” field, and there enter your replaceAll expression.

answered
0

Hi, there are some best answers already given for this. 

- What I also see is, in your screen shot, you have account object and you wanted to change the role name

- But you should understand that, one account can have multiple user roles

- So, first you must get the user roles of the account as a list and then change the role name within loop

 

Just in case if none of the above suggestions works for your case, you can also try the following. Although I am not sure what you are trying to do:

- Have a DS microflow on the data grid

- Within the DS microflow, create a non-persistent entity

- This non-persistent entity can have an attribute called user role and the role name can be changed with ReplaceAll method, as already mentioned in the above comments.

 

Again, there can be lot of approach for a problem. But it depends on what you wanted to achieve.

answered
0

thank you all for you collective help! i’ve learned so much.

here is what i ended up doing: 

since i have multiple custom content columns that all use the data source “account, by xpath” and when i tried to change one it changed them all, i kept that the same.

but i added a list object inside of the column in which i used a microflow to use the account as a parameter, retrieve the list of user roles and cast the list. 

inside the text object of the list i added the replaceAll expression that was mentioned above.

again, thank you all for helping me learn this! 

answered