SPFX: How to build a welcome web part where that web part displays the current user login name when they logged in [closed]

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/251499

  •  25-01-2021
  •  | 
  •  

Pergunta

How to build a welcome webpart to show the current user name after welcome in sharepoint online

Foi útil?

Solução

To build a welcome webpart, microsfot has a very well documented steps given here.

Here in step 7, they have declared some default properties to show on webpart. like description, test, etc.

Similarly, you can create one more property to show the display name of current user.

To get the details of current logged in user, check this question.

Also, in SharePoint online you can get the display name of current user using following code:

var currentUserName = _spPageContextInfo.userDisplayName;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top