0

How can i get task list with itemId programatically? Task list has a column named ReletadeItems, but this is formatted string,json.

I have ListItemId(ID) value, I want to get task list by this ListItemId with Caml query.

I can get all task list items and with foreach loop, parse reletadItems, then get ItemId. But I think this is not the apropriate way. I want to write caml query and getItems with caml query. How can i do that?

Forexample; this is reletadeItems value:

[{"ItemId":116,"WebId":"431c9bc1-67c6-4b49-9907-12f3bfbe5652","ListId":"349b2097-97ed-4d4f-976f-78700b2e2899"}]

I want to get task list items with ItemId..

-1

For those who are trying the same using CSOM.

Step 1: First query the list in which the workflow is running with Item ID - 2

Step 2: Read the Field name which is created with your workflow name. 'VetriWorkFlow' is the workflow name and field name.

(FieldUrlValue)mlstItems[0].FieldValues["VetriWorkFlow"];

Step 3: In this field you will be able to see an instance id. Capture the same and pass it to 'WF4InstanceId' column in Workflow Tasks list.

<Where><Eq><FieldRef Name='WF4InstanceId' /><Value Type='Text'>#instanceID</Value></Eq></Where>

Result: You will get the list of tasks that are created for the list item 2.

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.