For a customer we are building a complex approval process on Office 365 with SharePoint 2013 workflows. During the process we need to check if an list item (in an other list) existed. There is no default action that lets you do this. You can however us the set variable and if statement action to figure out if the item you are looking for exists or not. This is a useful trick to know when working with SharePoint 2013 workflows.
- Create a SharePoint 2013 workflow.
- Create a variable called ContractItemID, here we will try to store the ID of the list item we are trying to find.
- Set the variable to 0 (zero).
- Then we need to try and set the ContractItemID variable with the ContractID of the item we are searching. This can be from the same list or a different list.
- I am trying to find the ID of a list item with a specific Contract Number.
- If the workflow finds an ID the ID will be stored in the variable, if no item is found then the ContractItemID value will remain 0 (zero)
- Use an if statement to determine if the list item exists.