4

In short . . .

How do I do this:

Set a variable's value to the value of a field from a task assigned earlier in the workflow? In Step 1 of my workflow, the first action is to create/assign a task with Task ID of TaskID1. For the next action, how do I assign a field the value of a specific field from TaskID1?


Longer version . . .

I'm having trouble understanding the Lookup tool in SharePoint Designer's Text-Based workflow designer.

Most of the time it makes sense to me. For example, I want to set the current item's field. No problem. I start by choosing that action. I have the blank "Set field to value". For field I choose what field I want. When I click on value, I can use the Lookup to define the value.

I think I understand the Lookup at first. It's very self explanatory.

enter image description here

You've got a Data source, the field you want from the source and how that field is returned if applicable. If I choose the Current Item as the source, I can choose any of the fields that I've created as columns for the list's form. That's simple. Easy. But then, what is this?

enter image description here

I ask this, because I'm trying to set a specific list item field to what's entered into the field of a task assigned in the workflow. In other words:

I have an item list. I created a content type and a form for that item list with several custom fields. Additionally, because I want more task outcomes than just "Approved" and "Rejected" I created a custom task content type. Its parent is Workflow Task (SharePoint 2013). I made sure to associate it with the workflow I'm currently trying to configure.

enter image description here

enter image description here

enter image description here

In that workflow I assign that custom task to an approver. One of the custom task fields I made in the content type is Task Comments.

enter image description here

So when the approver opens the task, he/she should be able to put in comments. Okay. So I want to take those comments, pull them out and pass them to the current item. So my assumption is to use Action "Set Field in Current Item," then for the value use the Lookup and choose the task I just created in Step 1 of the workflow as Data source and Field from source as Task Comments. But it's not there as a Data source.

If the extra bottom section of the Lookup is designed to help me find the specific task I've just assigned, I don't understand how. Designer allows me to set a Task ID to it, but I don't see anywhere to pick that ID in Value in the Lookup tool.

Again, how do I do this:

Set a variable's value to the value of a field from a task assigned earlier in the workflow?

It seems like Microsoft could have made it more immediately apparent and easier to reference "task I just created one line above in this very Step of the workflow" . . .

7

to anyone who finds this in the future here is how i got around it. Association

  • This one helped me, Set Field as GUID and Value as Variable: TaskID. Thanks – Circus Ranger Jan 26 '16 at 10:38
  • Didn't they used to use the ID for lookups?? I was beating my head against this for two days ): – Kristopher Aug 19 '16 at 12:53
2

I had a similar situation using SharePoint 2013 and a 2013 workflow, and the following worked for me (when other suggested steps didn't):

Situation: I had a list of items and an approval task being run on those items. The approval task included unique answer fields to be filled in by the approver, and I wanted to copy these answers to empty fields on the original submitted item. The answered task fields were saving to the approval task item in the task list, but I needed to copy them over to the task item's original submitted item in the original/main list.

Solution that worked for me: In the workflow that contained the approval task, I added the 'Set field in current item' action. Field = the name of the current item field I wanted to fill in, and value = the lookup that matches the current item to its related task list entry. The lookup used Data Source: Association: Task List, Field from source: name of task list field I wanted to copy, Find the List Item - Field: GUID, and Find the List Item - Value: Current Item: GUID.

enter image description here

0
  1. In the lookup you should select DataSource = Task List
  2. Once you select that you will get extra fields at the bottom
  3. Select Field from source = Task Comments
  4. Return field as string
  5. Find the list item : Field = Task ID
  6. Value = Workflow variable task id
  • Do you mean Association: Task List as Data source? Because there is nothing that's just Task List. I hope not, because with Association: Task List chosen, there's no option to pick Task ID as the Field. – adhoclobster Nov 25 '14 at 16:06
  • You should pick the list where the task comments are stored. – Amal Hashim Nov 25 '14 at 16:10
  • It's a custom column stored in the custom task content type I created called Approve-Reject-More-Reassign (see 7th image above; the column itself has no parent). So where is that is the Data source list? – adhoclobster Nov 25 '14 at 16:14
  • These are my only options in the Data source dropdown: - Current Item - Workflow Variables and Parameters - Workflow Context - Association: History List - Association: Task List - Current List - Categories - Change Management (this is the name of my list and its item content type) - Community Members - Deliverables - Discussions List - Documents - Example - Issues - MicroFeed - Pages - Proposal proxy list - Risks - Site Assets - Site Pages - Tasks - Workflow Tasks – adhoclobster Nov 25 '14 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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