This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
There is a solution that can be used in any workflow, not just an App. One can use a function to determine the username executing the workflow on the Gallery. The workflow must be using Run As credentials in the Gallery and this works in version 2019.4.8.22007.
I like using this in a Generate Rows tool to bring it out of the ether instead of bringing in a Text Input tool with a dummy value first. I have attached a workflow to demonstrate this.
Side note: We have some workflows in production that can run in different modes on an ad hoc basis. Since these workflows take hours, the user who kicks them off usually does so in a fire and forget fashion. Hours later, the inevitable "I ran this in the wrong mode" sets in. I used the functionality above to find the username, query AD to get the user email, and within minutes send an email that the wrong mode was running.
The solution by @seven does not work for us at all, because it requires the Gallery to run apps as the user logged in, which ours doesn't, andcan'tdo. Our Gallery services run under a special service account, which is what is returned by this function. Users do not have the necessary permissions to do most of the functions we have in apps.
IMHO, stick with the solution posted by @mbarone, which also includes other essentials, like email address, FirstName, LastName, etc., until a better built-in solution is created.