Table of contents
Collapse the table of content
Expand the table of content

Load Dashboard

Ajinkya Kher|Last Updated: 11/23/2016
2 Contributors

Applies to: Skype for Business 2015

Local user

Using the mePerson object

The MePerson object is retrieved through the application.personsAndGroupsManager.mePerson property. For example, the following JavaScript code sample sets the availability of the signed in user to online.

// tell the mePerson to change the availability state

app.personsAndGroupsManager.mePerson.status.set('Online').then(function () {
    alert('The status of mePerson has been changed');
}).then(null, function (error) {
    // and if could not be changed, report the failure
    alert(error || 'The server has rejected this availability state.');

MePerson properties which can be set

locationGets or sets the location of the signed in user.
note.textGets or sets the personal note of the signed in user.
statusGets or sets the availability of the signed in user.

Note: When the above values contain special characters such as <, >, and they will be padded with zero width whitespace. This can cause equality operations to fail unexpectedly. One option for handling this situation is to filter out these special values so they are not used.

MePerson properties which are read-only

departmentGets the work department of the signed in user.
emailGets the primary email address of the signed in user.
emailsGets the email addresses associated with the signed in user.
displayNameGets the display name of the signed in user.
avatarUrlGets the photo URL of the signed in user.
titleGets the business title of the signed in user.
idGets the SIP URI of the signed in user.
function addContactCardDetail(item, value, cardContainer) {
    const detailDiv = document.createElement('div');
    detailDiv.innerHTML = item + ": " + value;

function createContactCard(contact, container) { () {
        var contactCardDiv = document.createElement('div');
        contactCardDiv.className = 'contactCard table';
        contact.displayName() && addContactCardDetail('Name', contact.displayName(), contactCardDiv); && addContactCardDetail('Company',, contactCardDiv);
        contact.department() && addContactCardDetail('Department', contact.department(), contactCardDiv); && addContactCardDetail('IM',, contactCardDiv);
        contact.emails().length !== 0 && addContactCardDetail('Email', contact.emails()[0].emailAddress(), contactCardDiv);
        contact.phoneNumbers().length !== 0 && addContactCardDetail('Phone', contact.phoneNumbers()[0].displayString(), contactCardDiv);

function populateContacts(contacts, container) {
    function populateSingleContact(contact) {
        // some of the properties you can access contact.displayName(), contact.note().text, contact.avatarUrl()
        processing = false;
    function loopOverAllContacts() {
        if (processing) {
        processing = true; i++;
        if (i == contacts.length) {
        var contact = contacts[i].result ? contacts[i].result : contacts[i];
        if (contact.type && contact.type() == 'Phone') {
        } else {
            // do an explict get on one property to fetch all properties
            contact.status.get().then(function () {
    var processing = false, i = -1;
    setInterval(loopOverAllContacts, 10);

var content = document.querySelector('.content')

// retrieve local user details
const mePerson = application.personsAndGroupsManager.mePerson;
const contactsDiv = content.querySelector('.contacts');
const mePersonArray = []; 
contactsDiv.innerHTML = '';
populateContacts(mePersonArray, contactsDiv);
createContactCard(mePerson, contactsDiv.querySelector('.contact'));


Show a person's information

Other resources


© 2017 Microsoft