Change/Switch Current User

I am looking for a way to allow a (specific) type of user (with the correct privileges) to change their logged in user to another user (that they select in a dropdown list)? The use case for this is to allow a manager the ability to go into the system as the other user to perform certain tasks, as that user. But, they do NOT need to go through the log in process and enter the users password. I have a dropdown that shows all the users that the person currently logged in can switch to. I want them to then click a button and the system changes then to that logged in person. I will also look to set an element to that persons original login and want to be able to have them switch back via pressing another button. Again, I don’t want them to have to go through providing a passord or anything, just select the user and the workflow switches to that user. Thanks for any ideas.

You can do this for the whole page by setting the page to type user then setting a workflow conditions that runs every time the dropdown value is changed then do a workflow to navigate to the same page then set the data to send the drop-downs value’s user.


1 Like

Thanks for the reply. I’m still a little confused at how to get it so the system sets the Current user to that selected User. I have the page to type user. I have the workflow upon select of the new user (from the dropdown) to Navigate back the the page that was loaded with Data to Send search for that selected User. It does not seem to change anything. I must be missing something. Thought this would be easy. But like other things, not as easy as you’d expect/hope.

Do you mind sharing the link to the editor then I can help yo better. If you prefer you can DM it. Lust be sure and go to setting>>general>>application rights and set to public.

Hi there @davidb2, nice name!

For this solution, you aren’t actually telling the system to update the Current User to the selected user. Rather, you’re telling the system to update the Current Page User to the selected user. Thus, to accomplish your use case of allowing managers to pose as other users, you’ll want to update all the references to Current User in your workflows and elements to be references to Current Page User (or Parent Group’s User if you’re operating within a group of type User and that group ultimately refers back to the Current Page User).

Another way to accomplish this would be to have a custom state on your page of type User - or a field on your User object of type User - that you update each time the dropdown with the list of users is changed. Then you would have all your references be to Current Page’s User (state) - or, with the second method, Current User’s User.

Let me know if I can clarify any of this. Best of luck with your building!

AirDev - Custom Software for Everyone

Thanks for the feedback, @david2 . I ended up doing the last item you mentioned via a field I set in the User record when they select the other user, and making all the necessary workflow changes. Wasn’t as bad as I thought it might be, and allows me to easily keep tabs on the original user (since that didn’t really change). Thanks again for taking the time out to help.

Thanks for taking the time @lester to help out and the offer. I ended up adding a field to the User record and set that when they changed the user, and updated my workflows to reference that field (which is set to themselves if not emulating another person). Turned out to be easier than I thought to make the changes. Thanks again for helping.

No problem at all - happy to help. I think going with the user field method was a good choice!

This topic was automatically closed after 70 days. New replies are no longer allowed.