Scenario:
Set anniversary date for employee based on joining date. If the anniversary date already passed today set for next year.
- Add #Joining Date and #Next Anniversary field in the form.
- Set formula for #Next Anniversary
DateTime(#Today.Year,#Form#JoiningDate.Month,#Form#JoiningDate.Day)
This is to set the Anniversary date as current year date.
- Add Automation
- Drag & drop condition block
- Type #Form#JoiningDate is not None and #Form#NextAnniversary is not None
- Drag & drop condition block
- Type #Form#NextAnniversary < #Today
(This condition to check the next anniversary date has been passed today or not)
- Drag & drop action and choose set block.
- Variable: Type #Form
- Expand property and add value
- Choose ‘Next Anniversary’
- Type value: #Form#NextAnniversary.AddYears(1)
(This to set next year date as next anniversary if the above anniversary date (based on formula) has been passed today.)
Overview of the block
Result
Date is not passed Today, so the next Anniversay date shows 2023 date.
Date is has been passed Today, so the next Anniversay date shows 2024 date.
Bonus Tips:
You can set notification for the anniversay now!
Related Topic: