How do I make an auto-updating school year?

Modified on Mon, 7 Jul at 11:48 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;
}
})()
Change the Month
By default, this component will flip to the new school year on July 1 each year.  To change this date to the first of a different month, simply change the 7 in the pink part of the code above to any other month's number (i.e. January = 1, February = 2, September = 9, etc.)
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!

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