Skip to main content

๐Ÿ’‰ Warn if MMR Date Is Too Early ๐Ÿ‘ถ

You might want to alert someone processing MMRโ€™s in a Workflow that the MMR was received before the studentโ€™s first birthdate.

This example compares the form Merge Field {{first_birthday}} to an MMR date field on a Reader form. A hidden, calculated field on the form outputs 1 or 0 to indicate valid or invalid, which then controls showing warning text, submission conditions, etc.

Merge Field Setup

first_birthday.png

first_birthday subquery.png

ย dateadd(year, 1, @Person-Birthdate)

Form Field Setup

Put a Calculation Formula like the following in the mmr1_valid field. Set datatype to Int and set the field to Hidden.

Setting the datatype to Int enables conditional logic filters weโ€™ll need later.

mmr1_valid calc.png

first_birthday = Date.parse('{{first_birthday}}'); mmr1 = Date.parse(@sys:field:mmr1); if (mmr1 < first_birthday) {0} else {1};

Insert instructions into the label:

instructions.png

<div class="error">
ย  Please ignore any MMR's received before a child's first birthday ({{first_birthday | date: 'd'}} in this case).
</div>

Example of displayed error:

mmr error display.png

๐Ÿ• Extra Toppings

Add a Submission Condition that looks for mmr1_valid = 1 and MMR1 field exists.