show AzureAD Username in Textbox

Solved
TK
Thorsten Konrad
essmannsbackstube

Our AD users can log in to a new app. Now I would like the name of the person logged in to be displayed in a text box. To do this, I have added the blockly below as an onload command to my app form. Unfortunately, the name is not displayed. Do any of you have an idea how I can achieve my goal?

a year ago
SOTI Snap
ANSWERS
DM

Hi Thorsten,

---

Please try using this JavaScript code instead:

```javascript


Snap.user.getFullName(function(username) {
    Snap.widgets.textbox.setValue('User', username);
});


```

TK

Hi Diya, thank you for your answer! Unfortunatley the code doesn´t work. The textbox keeps emty after login.

DM

Hi Thorsten,

Please publish the app and test it on a device. The 'User' block doesn't work in Preview mode but functions correctly on an actual device.

A
AKMOD@SOTI
a year ago

Hi Thorsten Konrad,

Thanks for posting on SOTI Pulse, Thanks Diya Merin Sunny for responding to the post, your expertise and willingness to help are greatly appreciated!

Have you had an opportunity to test the suggested solutions by Diya Merin Sunny and has it successfully addressed your query?

If not, or If you have any additional questions or concerns, please don't hesitate to reach out. We're dedicated to providing assistance and support.

Solution