Block - How to set Anniversary Date based on Joining Date

Scenario:
Set anniversary date for employee based on joining date. If the anniversary date already passed today set for next year.

  1. Add #Joining Date and #Next Anniversary field in the form.

  1. 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.

  1. Add Automation
  2. Drag & drop condition block
  3. Type #Form#JoiningDate is not None and #Form#NextAnniversary is not None
  4. Drag & drop condition block
  5. Type #Form#NextAnniversary < #Today

(This condition to check the next anniversary date has been passed today or not)

screenshot-2023.11.22-15_23_27

  1. Drag & drop action and choose set block.
  2. Variable: Type #Form
  3. Expand property and add value
  4. Choose ‘Next Anniversary’
  5. 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.

screenshot-2023.11.22-15_33_51

Bonus Tips:
You can set notification for the anniversay now! :partying_face:
screenshot-2023.11.22-15_38_40

Related Topic:

1 Like