SharePoint Designer, “Collect Data from User” and using those results.

Use the "Collect Data from User" action to create and assign a task to a user that prompts them for data.  Among other things, I’ve used it to prompt a user to approve or reject a request and enter some comments.

This action takes the form of:

Collect data from this user (Output to Variable: collect1)

Clicking on data pulls up a series of dialog boxes where you specify what data the user should provide when completing the task and this user is obvious.

The output part (Variable: collect1) saves the ID of the task.  You use this in your workflow to extract the user’s actual response via the "Compare any data source" condition. 

That condition shows as

If field equals value

Click on field and then the f(x) icon and it pulls up another dialog box.  Use this generalized dialog box to to tell SPD two things;

1. What is the list and column whose value you want to compare.

2. How should the workflow engine locate the specific row in that list?

To do this:

  1. Change the "Source" dropdown to point at the correct task list.  Note that the dialog box expands to show a "Find the List Item" section.
  2. In the Lookup Details field dropdown, select the name of the field whose value you want (this maps to what you called in the Collect data dialog box from above).
  3. In the "Find the List Item" section, select "Tasks:ID" in the Field dropdown.
  4. In the value field, click on the f(x).  This opens yet another dialog box.
  5. Change the source "Workflow Data"
  6. Select the workflow variable that matches to the "Output to Variable" from the Collect data action.
  7. Click OK/OK and you’re done.

It looks like this for me:

 

image

At this point, you can now use that value in your workflow as required.

Additional Notes:

As a brief aside, I always create an appropriately named workflow variable of type "List Item ID" and use that instead of the auto-generated "collect1". 

This "compare any data source" dialog set is used in several different places in SPD and is well worth mastering.

==end

Technorati Tags:

9 thoughts on “SharePoint Designer, “Collect Data from User” and using those results.

  1. Özgür

    I have same problem as samuel.

    PS: I experince this problem in Turkish language Sharepoint application for all users. However, in English application there is no such issue.

    Could you pls inform me about this problem and your solution.
    Thanks in advance.
    Kind Regards.

    Özgür KOÇ
    btozgurkoc@gmail.com

    Reply
  2. Ginni

    I want to add two columns from an existing form library into "Collect data from user" action rather than adding a new column so that when the approver opens the "Collect data from user" content type, he should be able to see those two column values from existing form library in to that "Collect data from user" content type only. Is that possible?

    Reply
  3. Tep Vuthy
    I’ve seen that, all users who have contribute permission to task list can edit (approve/reject) all task items, though they are not assigned to them???
     
    Any idea???
     
    Vuthy
    Reply
  4. ptgenszler
    I am trying to use update item in … to update the value, but when I use it, the fields in my "current document" – are not complete, so I am thinking that I am missing something
    Reply
  5. ptgenszler

    I have extracted the data entered by the user, but I am having trouble updating the task with a meaningful name.  Using SharePoint designer, the name is always the same, I want it to contain the name of the document being reviewed.  I even added an additional field to the task list to hold this, but I don’t know how to get it populated with the name of the document I am running the workflow on.  The built in workflow does this automatically (but it does not do the other things I need)

     

    Reply
  6. Paul Galvin
    I know that when a "??????" is sent in an email in place of a field, that means that the field is null.
     
    I would just double check things and see if you can imagine any way that the user didn’t fill in one of the fields. 
     
    Sorry for the late response.  I don’t get notified when a comment is left here.  In fact, I expect you won’t even see this response 🙁
     
    –Paul Galvin
     
    Reply
  7. Samuel Morin Jr.
    The "Collect Data from User" action has been causing problems… When I collect task data, the task doesnt store the values that selected.
     
    For instance:
     
    Step 1)
    Collect Data from user task (choice menu selected with "Approved" and "Declined" as the choices)
     
    Step 2)
    Email those values to a user. 

    The works great for most users, but some users receive an email with "?????" as the value selected.  This should be impossible, because I selected "Approved" as the default selection.

    I have tested this workflow through A virtual PC by emulating several users who had this problem (I signed into MOSS 2007 as the User with the problem).  When I check the assigned tasks for that user, I open and select Approve/Declined and then Complete Task.  This will cause the "?????" email issue. (See above)

    NOTE: I am correctly assigning the values to a variable named "List Item ID" and correctly referencing it in the email.

    Any ideas?

    Reply

Leave a Reply to Hamed Cancel reply

Your email address will not be published. Required fields are marked *