Update date field on change
For example automatically setting an end date when a start date is selected
Use this pattern when one field should recalculate related date fields as the user changes a value.
Scenario
This guide uses a duration field to update start and end dates automatically.
Build the form
- Add a Form for the
Jobstable - Add a number field for the duration
- Add a date picker for the start date
- Add a date picker for the end date
Add the actions
- Add a
Validate Formaction to the duration field - Add an
Update Field Valueaction that calculates the start date - Add a matching
Update Field Valueaction for the end date - Add a guard so the end date only updates when the start date exists
Use bindings to read the current value and JavaScript to add or subtract days.
Why this works
The user edits one value, and the other dates stay in sync.
App export
Downloads may take a few seconds.
Updated 4 months ago
Did this page help you?