How to show logged in Name and Location

%3CLINGO-SUB%20id%3D%22lingo-sub-3355984%22%20slang%3D%22en-US%22%3EHow%20to%20show%20logged%20in%20Name%20and%20Location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3355984%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20requirement%20to%20display%20the%20name%20and%20location%20of%20the%20logged-in%20user.%20Getting%20the%20name%20and%20location%20isn't%20an%20issue%20but%20how%20to%20place%20it%20using%20the%20Application%20Customizer%20is%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestion%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22anirudhaditya_0-1652257793661.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F370692iCF6BD8D28C57E213%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22anirudhaditya_0-1652257793661.png%22%20alt%3D%22anirudhaditya_0-1652257793661.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3381717%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20show%20logged%20in%20Name%20and%20Location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3381717%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1160743%22%20target%3D%22_blank%22%3E%40anirudhaditya%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EApplication%20customizers%20currently%20provide%202%20places%20to%20inject%20your%20display%20elements%2C%20one%20at%20the%20top%20of%20the%20page%2C%20which%20is%20right%20under%20the%20Suite%20Bar%20in%20your%20image%2C%20and%20one%20at%20the%20bottom%20of%20the%20page.%26nbsp%3B%20There%20is%20no%20option%20to%20add%2Fchange%20anything%20in%20the%20Suite%20Bar%20as%20part%20of%20an%20SPFx%20solution.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20possible%20to%20do%20DOM%20manipulation%20if%20you%20really%20need%20it%20in%20the%20Suite%20Bar%2C%20but%20that%20is%20not%20a%20recommended%20approach%20since%20Microsoft%20can%20(and%20does)%20change%20the%20Identifiers%20and%20Classes%20for%20Office%20365.%20If%20they%20change%20what%20you%20are%20using%20in%20your%20selector%2C%20your%20solution%20WILL%20break.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheck%20out%20the%20Extension%20Samples%20at%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fm365pnp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fm365pnp%3C%2FA%3E%26nbsp%3Bto%20get%20ideas%20on%20alternative%20ways%20to%20accomplish%20your%20result.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDon%20Kirkham%3C%2FP%3E%0A%3CP%3EMicrosoft%20MVP%2C%20Office%20Development%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin%3A%200in%3B%22%3E%3CSPAN%3EPlease%20click%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EMark%20as%20%3CSTRONG%3EBest%20Response%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%26amp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ELike%3C%2FSTRONG%3E%3CSPAN%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3Eif%20my%20post%20helped%20you%20to%20answer%20or%20resolve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ELike%3C%2FSTRONG%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

I have a requirement to display the name and location of the logged-in user. Getting the name and location isn't an issue but how to place it using the Application Customizer is?

 

Any suggestion?

 

anirudhaditya_0-1652257793661.png

 

1 Reply

@anirudhaditya 

Application customizers currently provide 2 places to inject your display elements, one at the top of the page, which is right under the Suite Bar in your image, and one at the bottom of the page.  There is no option to add/change anything in the Suite Bar as part of an SPFx solution.

 

It is possible to do DOM manipulation if you really need it in the Suite Bar, but that is not a recommended approach since Microsoft can (and does) change the Identifiers and Classes for Office 365. If they change what you are using in your selector, your solution WILL break.

 

Check out the Extension Samples at https://aka.ms/m365pnp to get ideas on alternative ways to accomplish your result. 

 

Don Kirkham

Microsoft MVP, Office Development

 

Please click Mark as Best Response & Like if my post helped you to answer or resolve 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.