I have an approval process in my InfoPath form. When the user presses a button called Approve or a button called Reject, it fills in 3 read-only fields: ApprovalName (with currently logged in user name); ApprovalDate (with today); and Approval (Boolean with blank default – true means approved, false means rejected).
In SharePoint Designer 2010 what I would do is to use an action called “Wait for field change” (not sure if that’s the exact action name). I would give it the ApprovalName field and say Wait until Field ApprovalName is not empty.
The reason I choose that field is because I do not wait to wait until Approval is true – because true means approved; what if it’s rejected? I can’t wait for it to be false either for that same reason. In 2010, it wouldn’t give you the choice for Boolean fields to say “is not empty” so I chose the text field instead, the person’s name, that gets auto-populated when the button is pressed.
I ran across 2 problems. The first of which is that in SharePoint Designer 2013, with the 2013-compatible workflow, you can no longer choose things like “Contains”, “Is NOT Equal to”, “Is greater than”, “Is not Empty”, etc. You can ONLY choose Is Equal To. As a matter of fact, it’s not even a choice – it’s hard-coded right in there – you can’t even click “is Equal To”.
So what I figured I’d do, is to create another field in InfoPath called ApprovalCompleted as a Boolean, with false as the default. When you press EITHER the Approve or Reject buttons, it turns the ApprovalCompleted field to true.
So I went in to SharePoint Designer and changed my Wait for Field Change to ApprovalCompleted. For the value it wouldn’t allow me to fill anything in – it only gave me a Yes or No. So I chose Yes.
No matter how many times I chose “True” in that blasted InfoPath Form, the Workflow would never get past that Wait for Field Change action – it never equaled.
I Googled around a bit and found that others had the same problem – Boolean fields just never match in a Wait for Field Change action. I think it’s because it’s storing it as a 1 or 0 and the action expects “Yes” or “No”.
So there’s 2 ways of handling this. One way is to go back into your InfoPath form and change ApprovalCompleted into a text field and have a textual representation of completion when they click the Approval or Rejection buttons. That way you can set the Wait for Field Change action to equal a particular string that you’ve set in the InfoPath form.
The other way to do it is to set up a Calculated Field on the Form Library. So to be clear, you need to promote ApprovalCompleted as a Boolean field (in this particular way of handling it) to the Form Library. Then you go into the Form Library and create a new field, and call it something like ApprovalCompletedCalc. Set its formula as just outputting the ApprovalCompleted field, and set its output format as a Number (doesn’t really matter if you use number or string here). Now in your workflow, you need to Wait for Field Change to be the field ApprovalCompletedCalc and it needs to equal the value 1 – 1 for true, and 0 for false. No quotes, just the number 1.
Couple of interesting things to note. First is, is that if you have that Calculated Field in your view, and you’ve TOLD it that it’s supposed to be a number, it’s still going to read as “Yes” and “No” EVEN THOUGH it’s really storing 0 and 1. To be clear, do NOT set your SPD workflow to look for “Yes” or “No” – it needs to be 1 or 0. But yes, the view is confusing and shows you the text.
Also, in SPD, in a condition, the Yes/No value seems to WORK right. So if you say “If Approval Is Equal To Yes” it works right. It captures the “true” or the 1. So it’s just that other action, the wait for field change action, that is messed up.