How to: Access Contact Data in Workflow Edit Task Forms
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
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.
Use the various properties of the Contact object to access the contact data.
TasksHow 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
ConceptsInfoPath Forms for Workflows
The Contact Selector Control