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
KMK91KMK91 

Compare Month and Year dates in flow

Hi All,

How to Compare Month and Year dates in flows.

EX : 

I took Variable 

Date : {!$Flow.CurrentDate}

Formuala (Here it's come current month)
-==========
Month : MONTH({!Date })
 
similarly how to take Year in flow.

Thanks
KMK

 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Did you try using the below formule.
 
Year({!$Flow.CurrentDate})

Let me know if this does not work.

If this solution helps, Please mark it as best answer.

Thanks,
​​​​​​​
KMK91KMK91
Hi Praveen,

How to compare FY like 2022 should grater than current year.

Thanks
KMK
KMK91KMK91
Hi Praveen,

How to compare Month and  Year in flows or
In  field how to compare Month and year.

Thanks
KMK
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

I dont think we can get the FY in the formula. If that is some contact then we can compare that with current year I guess.

Thanks,
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

For just comparing you can create a variable of type formule and return as boolean and use the syntax like below.
 
if(Year({!$Flow.CurrentDate}) > 2021, true,false)

If this solution helps, Please mark it as best answer.

Thanks,