Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Accessing the logged in User name in a workflow on server

wwatson
12 - Quasar

We have a use case where we want to use the logged in user name on server to restrict what a workflow shows them.

 

wwatson_0-1597062121394.png

 

We don't want the extract the server's own user but the user name of the person logged in and use that in the workflow to filter the output.

 

In my case that would be my name as shown.

 

Does anyone know how to access the Alteryx server logged in user name from within a workflow?

11 REPLIES 11
JustinBabbitt
Alteryx
Alteryx

@wwatson 

 

There is a way to use the UI Text Box tool to collect the Username of the user running the application. This is achieved when masking the Text Box tool (for API development) and naming it " __cloud:UserId". 

 

Attaching this Text Box to another tool, such as a Text Input, will allow the value to be used downstream. 

 

Check out @patrick_digan's response here for a screenshot: 

https://community.alteryx.com/t5/Alteryx-Designer/Get-username-Cloud-not-working/td-p/518481

 

Cheers, 
Justin Babbitt

Justin Babbitt
wwatson
12 - Quasar

Thanks Justin, we'll give that a go.

wwatson
12 - Quasar

@JustinBabbitt 

Your guidance got me to the user id. I added an extra piece to extract the username from the Alteryx Mongo DB, then used a render tool to display it on server as pcxml. Works a treat.

 

wwatson_0-1597134571554.jpeg

 

Krishna_nidar
6 - Meteoroid

Hi ,

 

I have a requirement to show the stored procedure result basis on the user ID in alteryx app not in the workflow. As many users may run the aateryx app (not workflow) from the gallery and respective output to be shown in the result only to that specific user

 

Could anyone help on this,please ?

 

Thank you 

Krishna_nidar
6 - Meteoroid

On continuation of the above query, also in our gallery, always the user names as for example "Alteryx Finance". At this time, how to validate? Pls help

 

ChrisMasonTampaBay
7 - Meteor

Hi Justin.  I'm trying to make this connection and what I pull from the mongo input doesn't match from the text box.  Is your mongo input connecting as User, AlteryxGallery, and then the Users table as below?

ChrisMasonTampaBay_0-1644852078910.png

 

adam_rafael_18
8 - Asteroid

Hi, would you be able to upload this portion of your workflow if you don't mind? Trying to work through a similar issue of collecting the user's user ID from the server. Thank you!

francois45p
6 - Meteoroid

@JustinBabbitt Thanks for the information.

 

It works for me as well. However the returned user id is not exactly the user SubscriptionId as stored in MongoDB. The returned id = SubscriptionId + 3 (i.e., instead of 63xxxxxxxxxxxxxf635 the Text Box tool return 63xxxxxxxxxxxxxf638. I tested this with few users.

I did not see any comment on this. So I am wondering whether this is specific to our settings or not.

 

Regards,

 

Francois

_VigneshRaja_
7 - Meteor

@wwatson Please share the sample workflow and steps. It will be useful for many users