I have a case where I have employee HR data, is there a way to have an app only display the "logged in" user for their data? PTO
Employee A is logged and can only view Employee A's Data.
Thank you
Solved! Go to Solution.
In 10.5 you can now choose to require a user to supply credentials with which the application will run on Gallery.
@pvara If you're in a private gallery setup (and perhaps using windows auth), you can use a text box interface tool and name it "__cloud:UserId" to get the user's ID. To get their name, you would have to then bring in the users table from the MongoDB.
Hey Patrick,
Any thoughts on why this wouldn't work in a macro? I have it working in an analytical app, but if I move that __cloud:UserId textbox into a macro, and then create a new analytical app that uses that macro, it no longer works.
Any help would be much appreciated.
Thanks,
Jon
@jonriddle fascinating. I agree with you that it doesn't seem to work inside a macro. I can't seem to think of a way around it. You should submit it as a product idea and I would be glad to star it :)
Thanks, the idea has been posted:
https://community.alteryx.com/t5/Alteryx-Product-Ideas/Use-cloud-UserId-in-a-Macro/idi-p/70641#M4166
Could you have your top level App work out the user ID using "__cloud:UserId" and then pass that through to the Text Box within the Macro?
Thanks for the tip JoeS. I made this change and have it working. This at least gets the majority of the flow into the macro. Hopefully we're able to get this into the macro sometime in the future to fully encapsulate the logic.
Thanks!
@patrick_digan Hi Patrick, this solution would be perfect for something i'm trying to achieve - Pulling user credentials of the user of the app to pass into the workflow and update a field.
I'm struggling with configuring it however.
Are you able to share a bit more detail on how each tool needs to be configured?
@CiaranA 1) You'll need a text box interface tool named __cloud:UserId in the annotation tab:
When it's run in the gallery, this will return the ID for the user (5554f9... in the below) that matches what you would see from the admin page on the gallery if you select a user:
2) In order to convert that ID to the user, you'll need to grab the users table from the MongoID like so:
3) You would need to get the password (i believe the regular one works) from the alteryx system settings on the server machine:
4) This mongo table will include an _id field in the form of { "$oid" : "55953eab6c9f3a0c48e1f" }. You would then just need join that ID inside the quotes with the id from the text box interface tool.
5) Once joined, you would then have the firstname and lastname as fields.
Unless you open up your mongo on the sever to be queried remotely (and then change the mongo tool to use the IP address of the machine instead of localhost), you would have to do this work on the server machine itself. and the __cloud:userID only works when run from the gallery.