๐ 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
ย 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.
first_birthday = Date.parse('{{first_birthday}}'); mmr1 = Date.parse(@sys:field:mmr1); if (mmr1 < first_birthday) {0} else {1};
Insert instructions into the label:
<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:
๐ Extra Toppings
Add a Submission Condition that looks for mmr1_valid
= 1 and MMR1 field exists.
No Comments