Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Include Username in Workflow

Alteryx Alumni (Retired)

I recently came across a customer who was asking how to include their local username within the workflow results. So here is a post showing how it can be done.

Option 1

Definitions of functions straight from

Function Definition: ‘GetEnvironmentVariable(Name): Returns the environment variable specified in Name. To get a list of environment variables, go to Control Panel > System > Advanced System Settings > Environment Variables. A list of system variables appears. Any value from this can be used.’

Formula: GetEnvironmentVariable("USERNAME")


Option 2

A colleague of mine showed that the GetEnvironmentVariable wasn’t always around and that he used to pull this data from the Registry. So I thought I would include that in here as well:

Function Definition: ‘ReadRegistryString(Key, ValueName, DefaultValue="): Returns a value from the registry.’

Formula: ReadRegistryString('HKEY_CURRENT_USER\Volatile Environment', 'USERNAME')


8 - Asteroid

Thanks for the info.  I used this code in a different way.  See this article.

8 - Asteroid

hmm neither work for me, perhaps a permission issue when I manually navigate: Control Panel > System > Advanced System Settings > Environment Variables, it wont let me see Advanced System Settings with my current credentials