community
cancel
Showing results for 
Search instead for 
Did you mean: 

alteryx server Discussions

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

Pulling the user info into the app from who ran it on the gallery

HI All,

 

I am hoping this is a silly question and there if a variable/constant I can drop into the workflow for this, but I want to bring the username of who is running the app into the workflow to dictate how the workflow runs. Does anyone know what that variable might be?

 

Workarounds I'd like to steer clear from:

- Handling the authentication through manually maintained authentication tables that I am comparing parameters I give the user (user, pw) . Clunky and multiple areas of authentication.

- Changing configuration of gallery to prompt for credentials before running app. I believe this would also require us granting privileges on the server to run apps for each user we would do this for. And I still think I'd have to use some run command to get that user info.

 

Any answers here are appreciated!

 

Best,

Kevin

Alteryx
Alteryx

Hi @The_Dev_Kev_Env,

 

You can do this with a TextBox named __cloud:UserId

 

There is an idea at the moment under review to include this as a constant.

 

Kane

Hi @KaneG,

 

Quite the Easter Egg! Thanks for this.

 

One follow-up question. I am assuming the output is the subscriptionID of the user and I am trying to map that to the user collection in the MongoDB. What I am seeing is that the subscriptionID that is outputted and the one in the collection are off by the last digit (numerically a diff of 1-5). I'm wondering if this is a case of updated subscriptions/versioning...

 

Have you seen this before? Is this also the suggested route in getting the user information (joining ID to Mongo instance).

 

Gallery Output:

gallery_output.PNG

 

Mongo output:

mongo_output.PNG

 

Best,

Kevin

Pulsar
Pulsar

Hi Kevin,

 

I have several app/gallery/collection reports I built.  What exactly are you trying to do?  Joining between different Mongo Collections can get convoluted very fast!!  If I knew exactly, I might have something already built that I can look into and let you know.

 

Hi @mbarone,

 

Thanks for the response. Actually came across a different thread where you provided a workflow to the parse through the user collection and grab the user id. Implemented that and works a like a charm.

 

Best,

Kevin

Pulsar
Pulsar

Great, glad to hear it!!

@mbaroneone more quick question.

 

Are there other similar functions to the __cloud:UserId. In particular, can I get the collection information from where the app is being run from?

 

Best,

Kevin

Pulsar
Pulsar

I only know about the cloud ID.  I think they're talking about adding a bunch more at some point in the future.

 

For Collections, I have a separate app that I run in the Gallery to see the different permutations of Collections/Users/App.  If it seems like something that might work for you, let me know:

 

Gal_Col01.jpgGal_Col02.jpgGal_Col03.jpgGal_Col04.jpg

Alteryx Certified Partner

Hi @The_Dev_Kev_Env,

 

It would be really useful if you could link to the solution you found for this. This issue is marked as 'solved' on the community but others are not able to find the answer from this thread.

 

Cheers,

 

Luke

Meteor

@mbarone Would you mind sharing your Collections app? I'm looking to write the name of the workflow in addition to the user info to a sql server db table. Is there a way to capture the workflow name in the gallery?