How to set a custom column in a workflow task.

Hello,

I'm looking for some assistance a bit with how to set a custom column in a Workflow Task.

I have a List Workflow that starts when an item is created in a list. The workflow, platform type SharePoint 2013, starts a new task, Task1, with Content Type 1. This Content Type has a custom column called Age. Once the Task1 is completed a new task, Task2, with Content Type 2, starts and has the same column Age, as Task1.

How can I populate the Age column in Task2 with the content of the Age column in Task1?

Since I start the task by running "Assign a task to ..." Action I was thinking to copy the Age column from the Task1 to the list item that started Task1, which has a column Age as well, and then in Task2 to start another workflow - which is associated with the Content Type 2,  that would try to read the Age column from the list item that started Task2, which was set once Task1 was competed - I know it's complex but this is how I was thinking. 

The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.

Is there a better approach? I use SharePoint Designer 2013 to design all this.

Any assistance is appreciated.

Thank you.


March 28th, 2015 11:22pm

Hello Sebastian,

you can get the Age column from Task 1 and then update the Task 2 Age column with that value. I am not sure why you want to run another workflow on Task 2.

You can perform below steps to set Age column from Task 1 to Task 2.

1.  Create Task 1 using Assign a task , wait till the task is completed.

2. Get the Age column value based on Task 1 once the task is completed.

3.Create Task 2 using Assign a task ,  uncheck wait till the task is completed option.

4. Update the Task 2 with Age column in Task1.

5. Use Wait for the field to equal value , check for Task Status is completed or not.

>>The problem with this approach is that I can't get a reference to the list item that started Task2 to read the Age from the list item.

you can get the related item from task list item to get the main list item.

Other option is, Use Javascript and CSOM  in task edit form to get the Age column from Task1 and prepoluate the Age value when Task2 is opened.

Hope this helps.

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 12:37am

Thanks Devendra, I didn't think about the approach that you recommended.

I got stuck at step 5, the "field" lists ONLY fields from the current item - which is my list item, not from the Task 2. Am I missing something? I need to know once Task 2 is completed so that I can progress to a new stage that creates Task 3, I need Task 2 to be completed before I start a new task, Task 3.

Note that I'm using SharePoint 2013 Platform Types

Thank you.



March 30th, 2015 9:40am

yes, you are correct. I am also seeing only current list Items fields. I was looking at VS workflow so i thought it works same way in designer but not.

You can do it other way, using loop with condition where Task status is completed and within the loop use "wait for an event in List Item " Action. This way you loop will check for Task status whenever there is an update of Task item.

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 12:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics