4

I've created a visual workflow that is used to create a contact. A part of creating a contact means that there MUST be a phone-number OR an e-mail address entered for the contact.

This means that I need to validate each of these fields with something like this:

E-Mail != NULL || Phone-Number != NULL

Unfortunately, my google searching has led me to believe that the functions ISNULL and ISBLANK don't work in visual workflow validation, and otherwise I can't seem to figure out how to construct this conditional.

Does anyone know if this is a limitation in visual workflow, or is there a way to make it work?

3
  • In workflow validation, if the conditional validates to true there is no error, so what I wrote in the original post is correct. I've tried the exact string in the original post, and have also tried substituting ISBLANK, ISNULL, and using your logical 'OR'. ISBLANK and ISNULL don't throw syntactical errors but don't work, the 'OR' isn't accepted at all.
    – Cdn_Dev
    Commented Nov 22, 2013 at 15:45
  • According to the following link, IsBlank and IsNull don't work: success.salesforce.com/ideaView?id=08730000000hpR4AAI ..... I wonder if there is another way.
    – Cdn_Dev
    Commented Nov 22, 2013 at 16:04
  • To be clear, this isn't a case of someone having no idea what they're doing. Writing a few booleans is easy enough, the problem is that it seems like there is a limitation in Salesforce visual workflow, and I want to confirm if that's true.
    – Cdn_Dev
    Commented Nov 22, 2013 at 19:37

4 Answers 4

1

From this link:

https://help.salesforce.com/HTViewHelpDoc?id=vpm_designer_about_formulas.htm&language=en_US

'If the user leaves the field blank, and the field is not required, no validation is performed'

It looks like this is indeed a limitation of visual work-flow. Ideally what I wanted to do was.. if a field was blank, it would only validate if the other field wasn't blank.. but it looks like if we don't make a field required and it's blank no validation is performed at all, making what I want to do impossible.

That said, I did find a workaround by using a decision screen where we were able to check the fields for null:

enter image description here

0

Did you try setting the default value for your input fields to be an empty string using {!$GlobalConstant.EmptyString} and then having a validation rule comparing the values after the form is filled to the same global constant?

2
  • doesn't seem to work. {!$GlobalConstant.EmptyString} is not available in the input validation formula. Even if you would try to compare the input value to your own "EmptyText" constant (which is available), it won't work. So far, only the approach from Canadian Coder seems to work. (decision step)
    – KoenVM
    Commented Nov 26, 2014 at 10:43
  • Another old trick is to look for values >a or >1 in those fields.
    – snugsfbay
    Commented Nov 26, 2014 at 13:10
0

I had a similar need, but on Lead instead of Contact. I found Canadian Coders findings to be true that validation doesn't work. But you could put the validation on a required field even though it's not one you're testing. I decided to put the validation check on the Last Name screen input since that is a required field. I had trouble with the ISBLANK as well so just used the following:

LEN({!Email}) > 1 || LEN({!Phone}) > 1

You could actually use the Regex formula to validate the Email and Phone further, but my client decided this may interfere with their sales.

0

I know this sounds a little wonky but I created a Flow and needed similar functionality. I added a default value of 0 to one of the text fields. My rules says IF field x != 0 then value a, if not value b. Not the most visually appealing but it did get me around the ISNULL / ISBLANK hole.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .