3

I'm building a SharePoint 2013 workflow (a list workflow) and I'm having a problem.

I have a list with some columns (City, Country, Date of Birth, Department and ID Number).

I've created an approval stage on this workflow and what I would like to do is, at the approval stage, the user should also fill the department and id number.

How can I achieve this in a SharePoint 2013 workflow ?

4
  • Is the workflow started manually? You could use the workflow initiation form (check the SP Designer top bar menu) to ask the user who starts the workflow to fill in the department and id number. Once added to the initiation form, the department and id number will be available as parameters under the workflow variables so you can sue those in your workflow to set the item fields.
    – Mihail
    Jul 18, 2016 at 10:38
  • Hi Asad,Thanks for your reply. The worflow it set to start automatically. Does it works the same way ? Jul 18, 2016 at 11:16
  • Does it start on on new items or modified items? Either way, you cannot use the workflow initiation form then. But if the workflow is not manual, how does the approval stage works? Does the approver interact directly with the item fields by changing their values?
    – Mihail
    Jul 18, 2016 at 13:06
  • Hi Asad. Yes, the approver interacts with the item fields directly. Based on Mike's suggestion I think I'm on the right way to achieve way. I've created a new "approval task content type" with the extra fields I need. Now I just need to update the "main list" with that values I guess (I'm kind of stucked on this). Thank you guys for your help. Jul 18, 2016 at 14:45

1 Answer 1

1

One way is to assign a task that is built on a custom task content type that contains the additional fields (department and id). When the task is completed, the workflow could update the main list with the data from the custom task.

Steps for creating the custom content type and using it from the workflow are here

Edit: to read the values in the task, note that the "assign a task" action saves the taskid to a variable (named TaskID by default). So for example, if you add a string variable (via the local variables window), you could add a "set workflow variable" action, and set it's value via:

Data source: association: task list

Field from source: Fieldname

find the list item Field: GUID

Find the list item value: variable:TaskID

5
  • Hi Mike, that's exactly what I need. I've just created a new content type with the fields I need. I'm just having difficullties updating the main list as soon as the task completes. Can you give me a tip ? Thanks again Jul 18, 2016 at 14:41
  • See my edit (Do I need to add a comment about seeing my edit? Or do you get an alert that the answer was modified?)
    – Mike2500
    Jul 18, 2016 at 14:58
  • Hi Mike, actually I dind't receive a notification (but I did not receive one with the comment either). I did the steps you've told me but my "main list" is not being updated by any chance. After I store the value in a variable with the steps you've told me I used the option to update a list item with the value from that variable. May I bother you to have a quick look of my WF ? s31.postimg.org/3m8re4o17/workflow_SP.png The field that I've created in the content type is the teste111. Thank you very much for your help. Jul 18, 2016 at 16:12
  • My bad. It's the GUID field that stores the TaskID. If you add a logging step right after the task, you can see this. Just log the value of the TaskID variable, and it will be a guid, not an integer. That means that the "find the list item: field" should be set to "GUID", not "ID". (while the "value" stays the same: "variable: taskid")
    – Mike2500
    Jul 18, 2016 at 16:35
  • Hi Mike, that's exactly what I needed. Thank you very much. Jul 19, 2016 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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