Take 1 of this tip was a bit of a mess from a formatting perspective, hopefully this one is better.
A common scenario in form development for any industry might be having to take an action based on how much date/time has lapsed between two dates.
This example will not cover all scenarios but once you understand the fundamentals, you can adapt it.
Workflow:
- End user enters the date of the Last Audit.
- If the Last Audit date is more than 365 days (8760 hours) since the last audit.
- Check a box indicating a violation.
- SMS the Supervisor/Manager with a message that this location (or asset, or warranty, etc) is in violation (or out of range, or past due, etc).
(or send an email, or update a data repository or whatever)
Building it:
First, build all your questions and make note of the Unique Identifiers you give the questions as you will need some of them later.
TIP: This is one reason you should have standards for how your unique identifiers are constructed. If your team spends the time to standardize it will save everyone
a ton of time later as you won't have to go look for the Unique Identifiers when you need them in DREL, CONDITIONAL LOGIC, ANALYTICS etc.
Question Label Question Type Properties
Q1: Last Audit Date: Date/Time Selector Range Validation property set to "In the Past"
Q2: Current Date: Date/Time Selector using Page Start as default Date/Time (You would hide this from the end user)
Q3: Hour Diff: Duration Math with the Start Date: 'Last Audit', End Date: 'Current Date' (You would hide this from the end user)
Q4: Violation: Single Checkbox (Controlled by Conditional Logic - See below)
Solution in use:
1. User enters the date of last inspection using a Date/Time selector with Range Validation set to "In the Past". (Required)

2. Current Date is entered automatically as it is using the Page Start as the date/time. (Hidden on Device)

3. Hour Diff: is populated automatically by the result of the calculation of hours between Last Audit Date and the Current Date.

4. Conditional Logic:
If the Duration Math question result - is greater - than 8760
Then
Is In 'Violation' (single checkbox question) - 'is set to' - Checked

5. SMS Data Destination with the filter :
Input Expression : %a[Violation]
Filter Expression: Yes

Additional Resources: Links to Product Documentation which discusses each.
1. Date/Time Selector
2. Default Value Source
3. Duration Math
4. Conditional Logic
5. Applying Filtering to Destinations
------------------------------
Stu Rathbone
Program Manager ~ Knowledge, Training & Enablement
ProntoForms
community@prontoforms.com------------------------------