How to configure a Recursive Search Filter for SharePoint Lists and Libraries in the K2 Workflow Designer
In the K2 Workflow Designer (legacy), you can configure a recursive search filter in the Update List Item and Update Document Properties wizards.
The recursive search filter allows you to configure a search filter for SharePoint list and library items in the root or in subfolders. The wizard searches all folders (including the root) within the targeted list or library.
The SharePoint list item and document steps in the K2 Workflow Designer do not expose the recursive Yes/No property, but you can still accomplish the same result using the steps provided here.
Follow the steps below to configure a recursive search filter in the K2 Workflow Designer. This example uses a custom list called Events with custom columns called Status and Department.
- Create a custom list called Events with two columns called Status and Department. Create list items in the list and enter Title and Department values.
Create a K2 application for the Events list.
- In the K2 Workflow Designer, select the Create Reference step from the Basic option in the Toolbox and drag it on to the canvas.
- On the Configuration Panel, select the Events SmartObject.
- Select the Get List Items method.
- Add two properties called Recursive and Department. Configure the Recursive property to Yes and Department property to IT.
- Name the reference Events Reference.
- Drag a Loop step from the Logic section of the Toolbox on to the canvas.
- Add the Events References to the List option in the Loop step.
- Add a End step to the Completed outcome.
- Add a Update List Item step to the Next Item outcome.
- On the Update List Item configuration panel, select Pick List Item and add the Events Reference.
- Add the Status property to the Properties section. Type Updated from WF: and add the Folio workflow item from the Workflow section in the Context Browser.
- Connect the Update List Item step to the Loop step.
- Configure the List section with the Events Reference.
- Save and deploy the workflow.
- Start an instance of the workflow.
- The workflow checks all list items that contain IT in the department column and updates the Status of those list items.