Expand my Community achievements bar.

SOLVED

Re: Validation Logic in custom forms

Avatar

Level 2

Hello! I'm trying to set up a validation logic where a different message will appear depending on the selection made on a single-select dropdown field, DE:Series. 

 

For example, if I select value "Option 1" in the Series field, I see the following text: Select Brief for content type. However if I select "Option 2", I want to see the following text: Select Podcast for content type.

 

I'm hitting a wall as I try to program the logic. This is what I have so far, but it's not working as expected:

IF({DE:Series}=="Option 1","Select Brief for content type."||{DE:Series}=="Suite Talk", "Select Podcast for content type.")

 

Is it possible to have multiple messages for each value in the logic? TIA!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Lyndsy,

I tried the below example and it seemed to work for me.   This is the code I put together:

IF({DE:Product Core}="Channels & Connectivity","Select Brief for content type.",IF({DE:Product Core}="Cross-Currency Payments","Select Podcast for content type"))

 

This is what the users sees on the form when they are filling it out and make their selection:

 

Kurt_Jones_0-1755192094790.png

Basically chaining together IF statements of all your options and what message you'd like to show the user.

View solution in original post

5 Replies

Avatar

Community Advisor

ZaidaGr1 -

Oops, I provided a response to Lyndsy by mistake, up above that was meant for you, see if that is a potential solution for you

Avatar

Level 2

@Kurt_Jones This worked, thank you!

Avatar

Correct answer by
Community Advisor

Lyndsy,

I tried the below example and it seemed to work for me.   This is the code I put together:

IF({DE:Product Core}="Channels & Connectivity","Select Brief for content type.",IF({DE:Product Core}="Cross-Currency Payments","Select Podcast for content type"))

 

This is what the users sees on the form when they are filling it out and make their selection:

 

Kurt_Jones_0-1755192094790.png

Basically chaining together IF statements of all your options and what message you'd like to show the user.

Avatar

Level 2

Hello @Kurt_Jones Could you suggest how do I set up Validation Logic on a Text field for the Business Code to start with 2 Numbers followed by dash (XX-) only, otherwise Error?

Copilot is giving me REGEXP specific code only.

 

Thank you in advance.

Avatar

Community Advisor

ashgpt,

This is a hack but I think it will work for you as Workfront doesn't do regex in validation as you've found out.

 

IF(LEFT({DE:TEsting},2)<100 && SUBSTR({DE:TEsting},2)="-","","Format for field needs to be ##- at the beginning")
 
The user will see this when they get to the custom field:
Kurt_Jones_0-1764976708105.png

 

Once they type in numbers appropriately the message will disappear:

Kurt_Jones_1-1764976886065.png

It's a hack as it's looking for the 2 leftmost items in my custom field to see if they are less than 100 (meaning either character can be 0-9) and a substring of the custom field looking at the 3rd character in the string (start is 0, second is 1, third is 2) should be a -   If those first two things are true then do nothing "" but if either is false then show the "Format....." message