Expand my Community achievements bar.

Don't miss the Workfront Community Lens, June Edition!
SOLVED

Re: Validation Logic in custom forms

Avatar

Level 6

I must be doing something stupid because my use case is very simple. I have a single-select dropdown on a form. And if someone selects "pods" from this field, I want a message stating that Pods-based materials cannot use that queue. (This is my intended workaround against being able to hide some options on one form.)

 

I used this simple if statement, but it doesn't work:

 

IF({DE:Who is creating your communication?}="pods","Pods-based materials cannot be reviewed in this queue.")
 
Is this possible?
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

When you say 'it's doing nothing' - WHERE is it doing nothing? When you try and test in Preview via the form designer? Or when you actually go to a record with that form/field attached and test there? If you're trying to see it work in Preview, then that's the actual issue. The logic doesn't fire in Preview, only on a live record. Your syntax is 100% correct, you'd be getting an error in the formula pane if it were invalid somehow.

View solution in original post

8 Replies

Avatar

Community Advisor

You're very close I think. Give this edit a try to start. You have to at least give if the 'false' criteria for sure.

 

IF({DE:Who is creating your communication?}="pods","Pods-based materials cannot be reviewed in this queue.","")

 

If that still doesn't work, check:

1. Case sensitivity - Is the drop-down option 'pods' or 'Pods'?

2. Custom field name - Is that exactly the syntax/capitalization/punctuation in the 'Name' of the field? (as it can be different from the 'Label' that's shown on the form.

Avatar

Level 6

Everything is as it needs to be. Field name is used, the value for the field is lower-case-p "pods." The only thing I didn't include in my example is the else you added with the comma...which I tried before. 

 

That's what's killing me. It's so simple and there has to be something off.  

Avatar

Community Advisor

In the example HERE, it shows the equals comparison as a double sign. Have you tried that one yet? I know I have some with '!=' working as expected.

 

 

 

Avatar

Community Advisor

I just tested both in my instance and both work. I even added a question mark to the field name (which normally I do not do), and that also failed to trip it up.

 

IF({DE:SYS User Type?}="Test User","not ok","")
IF({DE:SYS User Type?}="Test User","not ok")
 
I'd have to ask what you mean by "it doesn't work". What's it doing, exactly...?

Avatar

Level 6

The thing is that it's doing nothing.

The hope: The validation error will occur if someone chooses one of the choices in a single-select dropdown list.

I did a test field with four dropdown values. In this test, I want "C" to elicit the validation error:

 

JohnJOSullivan_0-1747141951596.pngJohnJOSullivan_1-1747141962776.png

I tried that with two equal signs, one equal sign, an "else" comma, no "else" comma. And when I test:

JohnJOSullivan_2-1747142013796.png

I've tried other examples listed here to validate that the general validation feature exists and works elsewhere...and they do.

 

 

Avatar

Correct answer by
Community Advisor

When you say 'it's doing nothing' - WHERE is it doing nothing? When you try and test in Preview via the form designer? Or when you actually go to a record with that form/field attached and test there? If you're trying to see it work in Preview, then that's the actual issue. The logic doesn't fire in Preview, only on a live record. Your syntax is 100% correct, you'd be getting an error in the formula pane if it were invalid somehow.

Avatar

Level 6

Oh for Pete's sake. 

Yeah, I look at the form in real life and the validation error occurs. 

That's what I get for trying something new EOD.

Thanks for all your help!

 

-j

Avatar

Community Advisor

To be fair, I only thought of that eventually because I remembered the late night /I/ spent swearing at it right after the feature went live! Glad you're on the right path now.