Forum Discussion
Get Current User Details SharePoint Online
Thanks for reaching out! I am currently utilizing that same script editor web part, that you have posted below. I am not exactly sure why it's not rendering the code. I have used the script editor to render other JS and HTML code but when it comes to obtaining user information, it will not render on my modern SharePoint page. I have attempted to utilize your example below with no luck. Also, I am an admin with full access.
DCady You have to enable the access to classic _spPageContextInfo from web part settings like:
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.