Assign user to variable inside App

Hi

I would like to know which user that uses the app, so how can I assign the username/email to a variable?

Thanks in advance

Hi @Michaeljep

e.g. via the environment variable:
Environment.UserName

in the app studio?
In Ui studio it will give me the user on the computer that executes the process, I need the username that triggers the process.

Are you talking about UiPath Apps Studio in Automation Cloud?

As far as I know this is currently not supported. Of course, you could set values while the related page is loading but the framework does not give you any standard variables from automation cloud you could use to place there.

That’s what I feared, maybe it’s something that will be added in the future.

Thanks for the question @Michaeljep! We don’t currently have this exposed in authoring, but we do have it in our backlog. In the meantime, you can always return the user’s name via an attended process.

Hi Evan, do you have any update on this? :slight_smile:

Hi @Obsev! We plan to ship that this summer :slight_smile:

Great news, thanks for update!

Is the shipping plan on the user variable from within the app a promise?

We at my company are looking into your App platform at the moment due to some conflicts with the Microsoft PowerApps License model and the use of their connectors.

We currently have ongoing discusions with your local sales manager about a future implementation of UiPath Apps

The ability to monitor which user that has created a specific robot task from the app is an essential feature for us, so that we can take action if a user is creating suspicious tasks.

We only use unattended robots from the standpoint that users should not be interupted in their work by a robot doing stuff on their pc.

@Martin_Ostergard_Lauridse We just showed this feature off to some of our UiPath Insiders this morning. If you aren’t an insider yet you should register so you can see and provide input on our product roadmap!

As for a timeline, it will be available in less than 2 weeks :slight_smile:

1 Like

There is a way to get the username/id of the UiPath App user and I have successfully implemented in one of my application.

Orchestrator http request for Audit Logs filtering the first dynamically invoked job and putting some more filters will return the UiPath App User accurately.

3 Likes

That’s a very good idea, thank you for sharing.

I have used this suggestion for fetching the user, until UiPath provides a more reliable solution:

  • Orchestrator HTTP Request activity with this endpoint:
    “odata/AuditLogs?$filter=Action eq ‘StartJob’ And DisplayName eq ‘{nameOfProcess}’&$select=UserName&$orderby=ExecutionTime desc&$top=1”
  • Deserialize into JSON Activity
  • Extracting the username: auditLogResponeJson(“value”)(0)(“UserName”).ToString

But in my example there is a limitation, if multiple users are using the App in parallel, you have to filter even more, probably look into the “Parameters” field, in order to make sure that you are picking the right username. In the “Parameters” field are all the input arguments which are received by the App.

Or we can wait for the next update that is bringing username and userid along with app variables to be used within the app

1 Like