Validation Logic in custom forms | Community
Skip to main content
skyehansen
Community Advisor and Adobe Champion
March 25, 2025

Validation Logic in custom forms

  • March 25, 2025
  • 12 replies
  • 5495 views

I'm opening up a discussion thread for the new functionality described here:

https://experienceleague.adobe.com/en/docs/workfront/using/administration-and-setup/customize/custom-forms/design-a-form/display-skip-logic-form-designer

 

(validation logic in custom forms)

 

Please add questions/issues or discovered functionality below. If you're posting something that works please use the format:

*use case

*code

*screenshot of expected result

 

thanks for your participation!

12 replies

skyehansen
Community Advisor and Adobe Champion
March 25, 2025

Use case -- "we want our users to provide an answer to a question, that is less than X number of characters"

 

Sample code:

IF(LEN({DE:Single Line Text Field})>50,"Please choose a name that is less than 50 characters")

 

Expected result: attached file

 

Doug_Den_Hoed_AtAppStore
Community Advisor
Community Advisor
March 26, 2025

 

Nice one @skyehansen,

 

Flip that coin and you can prevent people from writing MORE than a certain number of characters; not quite as good as seeing the count live as you approach the limit, but still, something.

 

Regards,

Doug 

skyehansen
Community Advisor and Adobe Champion
March 26, 2025

Use case -- "we have a 2 week SLA, but our requesters always seem to randomly pick tomorrow as a due date"

 

Sample code (this is specifically addressing a request queue, so works because the request hasn't yet been submitted (entry date is blank). Requesters could get around it by submitting and then changing the due date -- so admins should consider setting up additional code to guard against this.

IF(ISBLANK({entryDate}),IF({DE:Date Field}<ADDWEEKDAYS($$TODAY,10),"Please allow us at least 2 weeks to complete your request"))

 

Expected result:

Community Advisor
March 26, 2025

Really excited about this functionality, sooo many times I've been asked if we can put validation on custom fields.

 

Here's a use case i think would be good

 

Use Case: We need to prevent people entering special characters into a text field as the field is integrated with a system (AEM Assets) that doesn't support special characters

 

Sample code:

IF(CONTAINS("*",{DE:DAM_Asset name})||CONTAINS("/",{DE:DAM_Asset name})||CONTAINS(":",{DE:DAM_Asset name})||CONTAINS("[",{DE:DAM_Asset name})||CONTAINS("]",{DE:DAM_Asset name})||CONTAINS("|",{DE:DAM_Asset name})||CONTAINS("#",{DE:DAM_Asset name})||CONTAINS("%",{DE:DAM_Asset name})||CONTAINS("?",{DE:DAM_Asset name})||CONTAINS("&",{DE:DAM_Asset name})||CONTAINS("\\",{DE:DAM_Asset name})||CONTAINS("{",{DE:DAM_Asset name})||CONTAINS("}",{DE:DAM_Asset name}),"Special characters are not supported. Please only include alphanumeric characters.")

 

Expected result:

 

NOTE: getting this text mode to work was a bit "finicky" as certain special characters represent different things in text mode. i.e., curly brackets don't like to be read as a string since they are used to represent data attributes. Backslash was a pain as it's used to escape a character so I had to "escape the backslash" and add "\\" instead of "\". Might need more thorough testing to make sure all special characters are recognised appropriately, but in my quick testing I managed to get {}\/ to get recognised.

 

skyehansen
Community Advisor and Adobe Champion
March 27, 2025

Thanks Richard, that's fantastic. By the way, I recently figured out how to add quote marks to my expressions -- so in case these are also considered a special character by AEM Assets, you would just need to add another contains for '"' (this is a quote mark with an aspostrophe on either side).

 

I tested a few characters against your code using the "name" field on a request queue instead of a custom field, as we once had a case where our fusion scenario was barfing every time it got to the "pipe" symbol. So this would work well for those (fusion) cases as well. I added it to a date field just for kicks, to test it out, but the error message pops up nicely there as well (i.e. I put the name validation constraint in a random field on my form).

New Member
August 14, 2025

For some reason, enclosing the quote marks in between two apostrophes does not seem to work in validation logic expressions. At least, it is not working for me. I've used that trick in other areas, like calc fields, so I'm not sure why it wouldn't work the same in validation logic for a field. Have you figured out a way around this? I've tried backslash, commas, and nothing seems to allow me to escape and treat the quote mark character as a string.

lgaertner
Level 9
March 27, 2025

Hello,

 

I just found this discussion. Yesterday I opened this thread, as I do not understand how to use the FORMAT() expression on the new Validation logic functionality.

 

Does anybody see the Formatting Logic option in your instance?

I would love to have the possibility to have different stylings for negative and positive messages within the validation condition.

IF(LEN({DE:<custom field name>})<5,"foo","bar")

 

 

Regards

Lars

 

skyehansen
Community Advisor and Adobe Champion
March 27, 2025

Lars, while at Summit, I did hear that the new ARRAY functions' use cases are attached to "yet to be released" capabilities. I wonder if the same is true of the FORMAT functions -- there are other capabilities to be released in the future that these are tied to.

Kurt_Jones
Community Advisor
Community Advisor
March 27, 2025

These are all awesome examples.  I have one caveat to add to the conversation that others might come across (such as our instance) is your instance must be within the Adobe unified shell for you to see/use the Validation Logic.  In my case, I do not see a Validation Logic tab to use these features as we're not in the unified shell (you're in the unified shell when your main menu has moved to the left side and is now part of the hamburger menu as opposed to the right side where you see the 9-dot menu).

skyehansen
Community Advisor and Adobe Champion
March 27, 2025

Kurt, thanks for the additional heads up. I find that interesting, since the documentation says "all customers"

https://experienceleague.adobe.com/en/docs/workfront/using/product-announcements/product-releases/release-25-q2/25-q2-administrator-enhancements

 

Did you already get that confirmed by Workfront Support? If so, did they mention that they would get the documentation changed? If not, I might submit another case to ask them to update.

Kurt_Jones
Community Advisor
Community Advisor
March 27, 2025

Skye, we have 12 WF instances at JPMC across lines of business, I was able to confirm as some are unified some are not.  Those unified see it fine, those of us not, don't see it.  I will input a ticket to support and ask for the update, it should have an access required section like this page for Planning, https://experienceleague.adobe.com/en/docs/workfront/using/adobe-workfront-planning/adobe-workfront-planning-records/create-wf-objects-using-planning-automations, which clearly states you have to have the unified experience to this feature...which I confirmed with Tech Support and the Product Owner at Summit on that one as I can't see it in our Planning environment.  

William
Community Advisor
Community Advisor
March 27, 2025

Hands down the most exciting enhancement to Workfront since I began supporting it back around 2018. I never thought it would actually happen even in my most vivid fantasies. Been experimenting with it for a few days now, here's some examples and takeaways:

1. Exceptions handling: Keep in mind that applying any validation logic results in a required value for the field, even if the field is not set to "Required" in the form builder. Therefore if you want to enable validation for fields that are optional (maybe a value isn't provided until later in the project lifecycle), then you have to build logic into your statement that allows blank values.

Second, ask yourself under which circumstances might you need to override the data validation and then build logic to support that. E.g. if you create a validated Date field that only allows date selections that are beyond $$TODAY + 7d, keep in mind that if that date ever needs to be updated, the same rule will apply at the time of edit. So, if I initially choose "March 10" on a field on March 1, then on March 15 I need to correct the data to "March 17" I won't be able to do so. Takeaway: build in override logic to allow you to edit the values under certain conditions. This might be a "Data Override" checkbox that exists in a form section that is only visible/editable by admins or users with Manage access to the record. Or, the logic may not be enforced if the user is the project owner so owners can input any value on their project forms, but all other users are held to the validation rules. These support multiple conditions using && and || operators, so use those to create multiple conditions under which a value may be considered valid.

2. Error handling: the logic by which a value is not valid, followed by the logic to inform user that a value is not valid. You do not have to limit yourself to static invalid value statements. You can create advanced expressions to display dynamic invalid expressions. E.g. instead of something like "Minimum 100 characters required" you can create text mode to display "45 characters / 55 min. remaining" that acts as a live counter while the user inputs data.

3. Leveraging relationships: You can create logic that references other fields in the form, or logic that references the record's relationships. E.g. you can use logic like {ownerID} to reference the record's owner, so logic isn't enforced for them, or only the record owner is allowed to edit a field, etc. One example I will share below is "only project owner can select 'Rush' value in a dropdown. The 'Date Requested' field then allows for a date selection that would not otherwise fall within the SLA.

4. Inline editing: amazingly, validation is enforced in inline editing of values from list view. There are caveats to this, especially if you use the same field on multiple forms and this is compounded if that same field has different validation logic on the forms in which it appears.

 

Examples:

___________________________________________________________________

A. Only allow Project Owner to select "Rush" SLA

validation expression:

 

IF({ownerID}!=$$USER&&{DE:DV - Dropdown - Control Dates}="2",CONCAT("Only ",{owner}.{name}," may select X Rush"))

 

When anyone who is not the project owner (including admins) attempts to select "X Rush" an error is displayed:

___________________________________________________________________

B. This can also feed into downstream validated fields:

validation expression:

 

IF({DE:DV - Date - Dropdown SLA}<ADDDAYS($$TODAY,{DE:DV - Dropdown - Control Dates}),CONCAT("Earliest: ",ADDDAYS($$TODAY,{DE:DV - Dropdown - Control Dates})))

 

If the user selects a date prior to that which is allowed, they're informed of the earliest date that can be selected:

___________________________________________________________________

C. Error handling with character count, option to override based on "Override checkbox"

validation expression:

 

IF({DE:DV - Override}!="Disable Validation"&&LEN({DE:DV - Text - Min Length})<"7",CONCAT(LEN({DE:DV - Text - Min Length})," characters / ",("7"-LEN({DE:DV - Text - Min Length}))," remaining"))

 

enforcement can be overrided by checking this box:

and includes a running character count:

___________________________________________________________________

D. Lock specific fields to only allow record owner to input/edit:

validation expression:

 

IF({ownerID}!=$$USER,IF(ISBLANK({ownerID}),"Project Owner will provide this.",CONCAT("Only ",{owner}.{name}," can edit this.")))

 

If the user is not the owner, they are shown a character counter displaying how many characters entered/remaining:

___________________________________________________________________

E. Create a Typeahead that dynamically allows/rejects values based on other form inputs. In this example, if the user has input more than $10,000 in a budget field, they can only select a user in a subsequent User Typeahead field who is assigned a role of "Director"

validation expression:

 

IF({DE:DV - Override}!="Disable Validation"&&{DE:DV - Text - Budget}>"10000"&&{DE:DV - TA User - by Budget}.{role}!="Director","Requires Director Approver")

 

If the value in upstream field "DV - Text - Budget" is more than $10,000 only users with a Director role can be selected from the typeahead, even if there is no role filter enabled on the typeahead configuration.

___________________________________________________________________

F. Disallow values that are less than 10 days from the entry date; allow override; and allow blank values to keep the field optional:

validation expression:

 

IF({DE:DV - Override}!="Disable Validation"&&ISBLANK({DE:DV - Date - Deadline})!="true"&&{DE:DV - Date - Deadline}<ADDDAYS({entryDate},"10"),CONCAT("Earliest: ",ADDDAYS({entryDate},"10")))

 

Any value will trigger validation:

Blank value still allowed:

___________________________________________________________________

G. Enforce exact/minimum/maximum selections in a multi-select field. (Uses the new ARRAY functions):

validation expression (pick exactly two):

 

IF({DE:DV - Override}!="Disable Validation"&&ARRAYLENGTH(ARRAY({DE:DV - Checkbox - Pick exactly 2},","))!="2","Pick Exactly 2 Options")

 

validation expression (pick at least two):

 

IF({DE:DV - Override}!="Disable Validation"&&ARRAYLENGTH(ARRAY({DE:DV - Checkbox - Pick at least 2},","))<"2","Pick at least 2 choices")

 

validation expression (pick no more than two):

 

IF({DE:DV - Override}!="Disable Validation"&&ARRAYLENGTH(ARRAY({DE:DV - Checkbox - Pick no more than 2},","))>"2","Pick no more than 2 choices")

 

 

User then sees validation errors:

___________________________________________________________________

Lots more possibilities in both the validation rules and the messages displayed to user during input. I look forward to seeing other examples and sharing more of my own as we uncover interesting use cases.

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
Kurt_Jones
Community Advisor
Community Advisor
March 27, 2025

Mic Drop!  Whoa!  🙂

Rafal_Bainie
Community Advisor
Community Advisor
April 2, 2025

hi @skyehansen , thanks for starting great discussion!

qq, do you think this will be available in production with 25.4 release. Does this fall under:

or should I confirm this with support?

 

 

Kurt_Jones
Community Advisor
Community Advisor
April 2, 2025

I did input a ticket to support to ask about this as I was not seeing it in my preview (along with video and pic), however, after  doing that and having the team review, it does now show in my preview environment which they attributed to a recent maintenance update of the form in prep for the April release.  That said, my comment on needing to be behind the unified shell is no longer valid and the functionality should be showing in a person's preview whether or not they are behind the unified shell.

skyehansen
Community Advisor and Adobe Champion
April 2, 2025

thanks for following up! I appreciate you both. And yes, looking forward to seeing this in production next Thu.

ChrisStephens
Community Advisor
Community Advisor
April 4, 2025

One problem that I was running into a lot was that you can only have one business rule for an object event type, i.e. you can only have one business rule for project updates, but I needed to be able to apply different rules for different situations.

 

What I did to handle this was to create a "Business Rule Logic" field, then on the templates this field gets configured to determine which logic should be applied.

 

Community Advisor
April 18, 2025

I think I almost have my holy-grail of features here. Hoping someone else can close my gap on Scenario Three below to make it perfect.

 

In my instance, the use-case 'Can we make that field required for only company XYZ?' is incredibly common, and one I've not been able to support without creating extra company-level forms for each client. In this example, I applied field-level logic to a key field that's absolutely required for one specific client but optional for all others, and tested against the companyID of the project.

 

 

  • Scenario One: The project already existed, coded to that Company. Any attempt to delete the information in that field successfully triggers the expected error.
  • Scenario Two: The project is being newly created from a Template that has the Company pre-set to the one that triggers my error. This also successfully triggers the expected error message.
  • Scenario Three (Problem-Child): The project is being newly created from a generic Template that does not have a pre-set Company. Here I'm stuck and hoping someone else clever will know the trick. We have access to Business Rules, but I'd rather find a solution available to everyone if one exists.
    • The project's companyID field is not actually populated until the project is saved, so the formula fails to detect the error during creation.
    • I tried using a Native Field reference field as a trigger, without success.
    • I tried using a calculated field that contained the companyID value, also without success

 

Adobe Employee
April 21, 2025

Hi @katherinela. Thanks for sharing your use case. I can suggest the following:
1. You can add a Business Rule to check that all projects created from templates have the company field filled out. The expression might look like this

IF(!ISBLANK({templateID}) && ISBLANK({companyID}), "Please, select a company before creating the project")
Since the company field is not a required field for the project, but you have a logic depending on it, you can try enforcing that field this way.
2. Once a company is selected in the creation dialog, you can slightly modify your original expression and instead of referring to the {companyID} field you can reference the {company}.{ID} field. The logic is that if you are selecting the company object, you can reference its fields as well, the {companyID} field will be populated by the system after the project is created.
IF({company}.{ID} == "Your ID" && {DE:CreativeName} == "", "CreativeName required for This client's Deployments")​

3. Bonus Tip: You can even customize the error message to show the company's name if your use case needs so or it will be more helpful for the end-users. E.g.

IF({company}.{ID} == "Your ID" && {DE:CreativeName} == "", CONCAT("CreativeName required for ", {company}.{name}, "'s Deployments"))


Hope this helps

Level 4
April 23, 2025

I'm so glad they added this!

Am I going crazy, or does this not seem to support regular expressions?  I was asked to make an already existing text field not allow folks to enter text, only numbers. I thought I could do this using a regular expression, but the validation editor doesn't like the syntax I provide.  Has anyone been able to get something similar to work?

Something like this:

IF(REGEXP({DE:FieldName}, "^[0-9]+$"), "", "Please enter numbers only.");

  

Lyndsy-Denk
Community Advisor
Community Advisor
April 28, 2025

@cr17506599 This is an existing setting for fields, so you wouldn't need to set it via validation logic. It exists below the Instructions field. See the screenshot attached.

Level 4
April 28, 2025

Thank you! I did try that, but unfortunately, it won't let you change the format of the field if you already have custom forms out there that don't match the new format.  In our case we have several hundred forms with fields that contain text that we want to keep for historical purposes. I thought the new validation rules would be a nice middle ground, but can't get them to work for our particular use case.  We could also make a completely new field and hide the old one, not sure if that would hide the field on the forms that already exist though.