function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohit Soni 35Rohit Soni 35 

How to get the logged in userId/username in the Bot

Hi,

I am trying to get hold of the logged in userId/username in the Apex code invoked from the Einstein Bot , but it always returns the user used to run the Bot? ,  I did see some workaround like : https://blog.enree.co/2018/11/salesforce-dealing-with-the-running-user-on-einstein-bot-dialogs.html

Isn't there a straightforward way to achieve this?

Thanks
VinayVinay (Salesforce Developers) 
Hi Rohit,

Check below reference that can help you.

https://blog.enree.co/2018/11/salesforce-dealing-with-the-running-user-on-einstein-bot-dialogs.html

Thanks,