How to: Access Contact Data in Workflow Edit Task FormsĀ 

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Microsoft Windows SharePoint Services (version 3) sends the data from workflow task forms to the workflow as a hash table, in which each key-value pair is indexed by the name of the field control on the form. For example, suppose the Contact Selector on your form is named myUsers. In this case, you access your contact data in the hash table by specifying myUsers as the index.

This hash table can be accessed by using the ExtendedProperties property of the SPWorkflowTaskProperties object. The SPWorkflowTaskProperties object can be accessed by using the TaskProperties property of the workflow task activity for which the task from is displayed, such as CreateTask, UpdateTask, CompleteTask, or DeleteTask.

For more information on accessing workflow task data, see How to: Access Workflow Task Form Data in a Workflow.

For more information on workflow task forms, see Workflow Task Forms (Office SharePoint Server 2007).

For more information on specific task activities, see the Microsoft Windows SharePoint Services (version 3) SDK.

To access Contact Selector control data in workflow task forms

  1. Use the Contact.ToContacts method to deserialize the hash table contact data into an array of Contact objects.

    Contacts[] contacts = Contact.ToContacts(taskProperties.ExtendedProperties["myUsers"].ToString());
    

    In the above example, the name of the field bound to the contact selector is "myUsers". Therefore, "myUsers" is also the index of the name-value pair in the hash table that contains the contact data.

  2. Use the various properties of the Contact object to access the contact data.

See Also

Tasks

How To: Add the Contact Selector to InfoPath 2007
How To: Configure a Contact Selector Control on Your InfoPath Workflow Form
How to: Access Contact Data in Workflow Initiation and Modification Forms
How to: Access Workflow Task Form Data in a Workflow
How to: Design a Workflow Task Form to Use Task Data

Concepts

InfoPath Forms for Workflows
The Contact Selector Control