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
Complete noviceComplete novice 

Returning current year in Visualflow

Hi, I have created a flow to add an opportunity from a button.  I need to be able to populate a field with the current year, but I can't work out how to do it.  Can anyone help please?
Thanks
Best Answer chosen by Complete novice
Gaurav HandooGaurav Handoo
Hi!!

Create a formula in your flow 
Year({!$Flow.CurrentDate})

Wherever you are assigning values to be populated in opportunity, assign the required field with the formula and that should work.

Cheers!!

Gaurav

All Answers

Gaurav HandooGaurav Handoo
Hi!!

Create a formula in your flow 
Year({!$Flow.CurrentDate})

Wherever you are assigning values to be populated in opportunity, assign the required field with the formula and that should work.

Cheers!!

Gaurav
This was selected as the best answer
Complete noviceComplete novice
Perfect, that works, thank you.  I don't know why I couldn't work that out.
honeyfayehoneyfaye
1. What would the Data Type for the formula above?
2. What's the flow formula for Last Year?