Salesforce Fact #457 | Get current user role name in flow

In apex, in order to get the current user role name we need to query the UserRole object. We cannot get it directly using UserInfo object since it has only one method related to role i.e getUserRoleId(). Using this Id returned we can get the data from UserRole object. But that is not that complex in flow.

In case of flow, we can directly get the current user role name using the syntax: {!$UserRole.Name}.

Attached are the screenshots.





Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow