I'm using Document Sets in a Sharepoint 2013 Online system. There are several workflows for my Document Set that create tasks using the "Start Task Process" action.
My goal is to get the Task list on the Document Set Welcome page to show only tasks associated to the Document Set.
I tried to use the solution in This Article, but the "WorkflowItemId" column doesn't seem to exist. I don't have a "Workflow Tasks" list, just "Tasks", so perhaps I'm missing something here.
Since the Document Set ID is not directly stored as a column in the "Task" List, I found a column called "Related Items". That column has a JSON list that contains the items, it looks like this:
[{"ItemId":21,"WebId":"b7164bd7-db95-4948-88b5-0edd86b8ce2d","ListId":"152f780e-9f33-403f-8a3b-2974ab673346"}]
I can't create a calculated column against "Related Items" since the field is not available, so I then took a look at creating a workflow that fires on Task creation. It grabs the "Related Items" value and stores it as a string in a new column I called "Related_Item_JSON". I can then use a calculated column to get the ID. **If this can be done in the workflow, I couldn't figure it out.
The first issue comes up with the Workflow. Because I am creating the task in the Workflow, the Workflow that I created to run on task creation does not fire. I read this is a security feature, but if there is a way around it, it would probably solve this problem.
To continue testing, I ran the workflow manually so I had the ID available in my calculated column. I created a variable that would grab the QueryString ID from the Document Set Page. When I filter the calculated column to equal this ID it does not work, but if I switch to contains it does. I believe this is because the calculated column is returning "string#21" instead of just "21". I've tried adding string before my QueryString variable, but it doesn't seem to work that way.
<Contains>
<FieldRef Name="Calculated_x0020_ID"/>
<Value Type="Text">{workflowitemId}</Value>
</Contains>
So the second component to my issue would be how to get my filter condition to be equals and work.