I want to create a workflow that will email users when a question that was posted on the discussion board has gone unanswered for 48 hours. I can't seem to figure it out and have tried searching but all i see are setting workflows for
A little background info to get this working:
- Discussion boards have two content types: Discussion and message.
- Messages are the replies
- Like all items in SP, Discussions and messages both have an ID property
- Messages have a ParentItemID property, which is the id of the discussion that the reply is connected with.
With the above, you can create the following workflow:
First, set the workflow to run for each new item, but only for items of content type "discussion". (both of these are set on the workflow settings screen in spd). Also, create two workflow variables: DiscussionID and ReplyID. Then:
- Pause for 48 hours
- Set DiscussionID = CurrentItem:ID
- Set ReplyID = workflow lookup: data source: current list field from source: ID where field: parent item id = value: variable: currentitemid
- if ReplyID = 0, then send notification that there were no replies
To translate the above, for each new discussion, the workflow waits 48 hours, and then queries the list for any replies that have a parent item id of the original disucssion. If there are 20 replies, this step only returns the first. But we don't care how many replies there are, only whether or not there are any replies. If there are no replies at all, then the replyid variable will be 0.