Get user details

In my SP Form, I wanted to show in the banner the name of the person who is using the form. How can I achieve this?

As an example;

Welcome John Smith!

Hello @Jamail_Serio,

You can get the current user name using the code:

_spPageContextInfo.userDisplayName

And to add a banner with the current user name, you can add a Rich Text or HTML control, and change the text and the styling dynamically like this:

fd.control('RichText1').$el.innerHTML = '<p style="text-align:Justify;font-style:italic;font-size:24px;color:#FF0000;">Hello ' + _spPageContextInfo.userDisplayName + '!</p>'
2 Likes