Sorry, you can only use it in an xpath retrieve.
What you can do is:
- Retreive the manager role in the Onchange microflow (see image above)
- Retrieve all roles by association from the account parameter (which will give back a list of the selected user roles)
- Use list operation contains to check if the manager userrole is in the list.
Contains will give back a boolean which you can use to set the isManager boolean.
You can add a boolean (if you have only this situation, otherwise you can maybe better use a enum) isManager to the Account entity. Then set an onchange on the rol selection. In the onchange microflow, you can check if the manager rol is selected and if so, set the isManager boolean to true.
Then you can make the extra field visible based on the new boolean.
I tried your solution but I don’t manage to retrieve the rolename with the command you propose. The only possibilities that I have are there :
I put you screens over here of what I tried :
The real role name is ‘CUW’ : Below the microflow that tests if it is selected by the user.
Could you let me know if it was what you meant @Sander ? With this microflow, the field is never displaying (so the isCUW variable stays to false anyway apparently).
(And instead of using “$Flag = true” you can just use $Flag when check if a boolean is true.)
Here are my answers to your questions :
The “onchange” microflow is called on the field “User role”, since it is by changing it that I want the field “Hub” to appear
And here is the Microflow : as you see I change the attribute “isCuw” depending on the flag value, by doing a commit & refresh in client (icons show it).
Even when I put a breakpoint, I don’t manage to debug since the program doesn’t stop after a change on the field (I don’t understand why exactly).
I guess that it has something to do with the “Role = CUW”, my flag is presummably always false as you guess, but I don’t know why. I’ll give you other screens to show you what I do in the microflow :
Finally, here is the condition used :
By the way if someone knows, I have a quite similar problem with a button that I try to make disapear in a list view, but when I do it and activate the “Refresh in client” in my change action of the boolean variable, the list view is charging indefinitely…
The ticket is over there : https://forum.mendix.com/link/questions/93748