Accepted Solution

How to pass pass username

Hi all,

is there a way to pass the username/id from the user who starts the workflow?

Is the name stored in the database?



Re: How to pass pass username


Not sure I totally understood your question.

If you are asking about access to username who triggered the workflow execution during execution, you can get it using the Cmdlet Get-WfaRestParameter in your command code.

The certified command "Send email" has the sample code that uses this Cmdlet. A screenshot depicting the same:



Re: How to pass pass username

Hello Christian,

Shailaja's answer is correct for using it in commands.

Should you need it in user inputs - I am copying from another thread I responded to something similiar:

In 2.0, if you'd go and define a user input called "$_WFAUser" you'd be able to get that value (Of the user currently logged in to WFA).

It would be a read only input (ie shown on the screen in preview) with a pre-defined tooltip.

You can use it in queries to correlate the logged in user with information from additional tables (Either native ones from the DFM cache

or with proprietary info from the user-specific playground DB).

While admittedly it can use a little more polish - I believe this is very usable and will offer a viable solution to most use cases.

Hope you might find that useful.



Re: How to pass pass username

Great. That is exactly what I have been looking for.

Thanks Shailaja