Confusion about Admin.Account entity and $CurrectUser (System.User)

When the admin screen is used to create a new user it creates an Admin.account entity. In any microflow I battle to see how to retrieve that account entity for the logged in user. I can see that account inherits from user but I cannot directly see how they are linked. From a microflows perspective how can I retrieve the account for a loggedin user?
3 answers

You want to do that using an inheritance split.
The current user is always available as a variable in your microflow. If you put in a inheritance split (the green one), you can select current user.

You need to specify a flow for each of the subclasses. If you add a 'Cast' activity as the first element in the flow it will automatically cast it to the type you had selected for that flow.
See also the documentation for the inheritance split


In this example ( the inheritance split seems to call direct logic based on the type of user. What I am trying to do is physically make the currentUser object into an account entity. If I use inheritance split then my logic will never fire because the Microflow will always split logic based on type and the type will always be user type.

To give you more background: I have created Entity A which is associated with the Admin.Account entity. When a new Entity A is created I want to link it to the Admin.Account entity of the logged in user.

Here is an image of my Microflow. Essentially I need the top flow to fire every time. I need to cast the User entity to an Account entity.


How did you accomplish this? I am butting up against the same exact thing. Added to mine is SSO. When the user authenticates through SSO, at that point I want to create an admin account for them however I appear to be unable to figure out how to ‘elevate’ the user to an appropriate account with a role.