Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using a SharePoint Designer 2010 custom approval workflow. I capture an initiation form parameter and save that value into a field in the list item associated with the workflow.

I need to display this value on the task edit form. I created a task form field, but I cannot find a way to set it from the workflow variable or the list item.

share|improve this question

3 Answers 3

Task Item have a WorkflowItemId field. You can add list as datasource to infopath and find element by Id.

share|improve this answer
    
I added a secondary datasource for the SharePoint list on which I am running the workflow, but I do not see any field in that list to connect to the workflow. Also, I don't see a WorkflowItemId field for the task item; I'm looking at the Main data connection on my task edit form. –  Laurie Apr 15 '11 at 22:08
up vote 1 down vote accepted

Edit the Approval workflow

  1. Add a Task Form Field.
  2. Change the behavior of a single task.
  3. In Step(Before a Task is Assigned), add action: Set Task Field, assign to the Task Form Field the Initiation Form parameter.
  4. In InfoPath, add the Task Form field to the Task Edit form (it is available in the Main data connection)
share|improve this answer

I ended up solving it this way:

  1. Added a column to the Tasks list

  2. Created a secondary workflow on the Tasks list to populate this new column. This is done with the "Update List Item" action and doing a lookup to my doc library, matching the ID to the Workflow Item ID.

  3. In InfoPath, added a new data connection to the Tasks list to get my new column.

  4. Added the field from the Tasks list onto my InfoPath form and added a rule to hide the control if the ID <> Main Connection.ID

  5. Then, I would get this error intermittently: "this task is currently locked by another running workflow and cannot be edited". To fix it I added a column to my doc library for a flag, which I set while the secondary workflow was updating the task. Then I had the primary workflow wait for that flag, before continuing.

share|improve this answer
    
I started merging your answers and then realised they were different. I'm a little confused as this is the answer that solved your problem, but you have marked the other answer with a tick. Could you please clarify? –  Alex Angas May 11 '11 at 2:56
    
My original solution sort-of worked, but having a second workflow caused errors when I had multiple approvers. The accepted answer is the better solution - it is simpler and works every time. –  Laurie May 11 '11 at 3:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.