How do I make an auto-updating school year?

Modified on Tue, 17 Jun at 7:22 AM

Using an auto-updating school year lets you place a single, smart tag that always shows the correct school year without manual edits each summer.  Build it once, and your forms and email notifications stay accurate all year-round.

Add a Computed Component

1

On your form, drop in a Computed Component and set its formula equal to:

(()=>{
let todayDate = new Date();
let currentYear = todayDate.getFullYear();
let lastYear = currentYear - 1;
let nextYear = currentYear + 1;
let currentMonth = todayDate.getMonth() + 1;

if(currentMonth >= 7) {
return currentYear + '-' + (nextYear);
} else {
return lastYear + '-' + currentYear;
}
})()
2

Set the field ID of the computed component to schoolYear and set the component to Always Hide (under the component's Show/Hide Rules).

3

Now, when you want to reference the school year dynamically on your form or in email notifications, use ##schoolYear## to merge-in the calculated school year.  Simple!

Need your year to flip earlier?  Change currentMonth >= 7 to a lower number.  For example, use >= 4 if you want the school year to change on April 1.

That is all it takes.  One computed component and one merge tag keep every form and email up to date year after year!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article