function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ahonahon 

validate input - screen flow

Is there a way to have 2 conditions in a formula under validate input on a screen component? Currently, the following is, in fact, working and triggering an error message:

{!Cancellation_Date} <= TODAY()

However, there are 2 conditions required and each time I attempt to add another condition, as seen below, the flow fails.

AND(
    {!Cancellation_Date} <= TODAY(), 
    {!Cancellation_Date} >= Sale_Date__c
)
Best Answer chosen by ahon
HarshHarsh (Salesforce Developers) 
Hi Ahon,
 
{!Cancellation_Date} <= TODAY() &&
    {!Cancellation_Date} >= Sale_Date__c

Please try the above code in your Validate input option in the screen flow

Please mark it as Best Answer if the above information was helpful.

Thanks.




Important Update - what you need to do
User-added image
As a reminder, on December 4, 2023 the Salesforce Discussion Forums will be removed from the Salesforce Developers website. These forums will shut down and all relevant discussions will migrate to the Trailblazer Community digital platform.

During the week starting November 20, you can view discussions, but not post new questions or responses. On December 4, you will no longer be able to access the discussion forums from the Salesforce Developers website.

Please take these steps before November 30, 2023, 11:59 p.m. PT to ensure your contributions follow you to the Trailblazer Community:
  1. If you’re not already a member of the Trailblazer Communitysign up for a Trailblazer account using the same login email address associated with your Developer Discussion Forums account. This is crucial.
  2. If you already have a Trailblazer account, and it’s using a different email address from your Developer Discussion Forums account, we recommend that you log in to the Trailblazer Community and connect your forums email address to your Trailblazer account.
Find more info & support
We know that moving platforms can be a hassle, so we created a special forums users group, the Migration Support Hub, in the Trailblazer Community where you can get training videos, information, and assistance.

We are here to help you through this transition!

Sincerely,
The Forums Support Team
 

All Answers

HarshHarsh (Salesforce Developers) 
Hi Ahon,
 
{!Cancellation_Date} <= TODAY() &&
    {!Cancellation_Date} >= Sale_Date__c

Please try the above code in your Validate input option in the screen flow

Please mark it as Best Answer if the above information was helpful.

Thanks.




Important Update - what you need to do
User-added image
As a reminder, on December 4, 2023 the Salesforce Discussion Forums will be removed from the Salesforce Developers website. These forums will shut down and all relevant discussions will migrate to the Trailblazer Community digital platform.

During the week starting November 20, you can view discussions, but not post new questions or responses. On December 4, you will no longer be able to access the discussion forums from the Salesforce Developers website.

Please take these steps before November 30, 2023, 11:59 p.m. PT to ensure your contributions follow you to the Trailblazer Community:
  1. If you’re not already a member of the Trailblazer Communitysign up for a Trailblazer account using the same login email address associated with your Developer Discussion Forums account. This is crucial.
  2. If you already have a Trailblazer account, and it’s using a different email address from your Developer Discussion Forums account, we recommend that you log in to the Trailblazer Community and connect your forums email address to your Trailblazer account.
Find more info & support
We know that moving platforms can be a hassle, so we created a special forums users group, the Migration Support Hub, in the Trailblazer Community where you can get training videos, information, and assistance.

We are here to help you through this transition!

Sincerely,
The Forums Support Team
 
This was selected as the best answer
ahonahon
@harsh as of most recently, this formula is working. appreciate the assistance.

*I attempted this exact formula at one point previously and the flow resulted in a fault.
Alexander james 4Alexander james 4
Yes, you can have multiple conditions in a formula for validating input on a screen component. The issue might be in the syntax. Ensure there are no extra spaces and use the logical AND function correctly. Here's the corrected version:

AND( {!Cancellation_Date} <= TODAY(), {!Cancellation_Date} >= {!Sale_Date__c} )
Make sure to replace {!Sale_Date__c} with the actual API name of the Sale Date field.