ContactPicker.PickSingleContactAsync | pickSingleContactAsync method

0 out of 3 rated this helpful - Rate this topic

Launches the Contact Picker for selecting a single contact.

Syntax


contactPicker.pickSingleContactAsync().done( /* Your success and error handlers */ );

Parameters

This method has no parameters.

Return value

Type: IAsyncOperation<ContactInformation>

The operation that launches the Contact Picker.

Remarks

To pick multiple contacts at once, use PickMultipleContactsAsync.

Use the SelectionMode property to control whether your app receives all of a contact's information, or just specific fields.

Examples

This example demonstrates how to use the PickSingleContactAsync method.


function selectContact() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.email);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        contactElement.innerText = contact.name + " " + contact.emails[0].value;
        document.body.appendChild(contactElement);
    });
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Namespace

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Metadata

Windows.winmd

See also

ContactPicker

 

 

Build date: 12/4/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.