The Pyrus scripting platform lets users expand the functionality of Pyrus forms to do things like:
The scripts are written in JavaScript and executed within Pyrus forms. The platform provides a trusted environment to run these scripts and controls their access to your data.
To try out Pyrus scripts, follow these steps:
form.onChange(['Start date', 'End date']) .setValue('Duration', state => { const startDate = state.changes[0].date; const endDate = state.changes[1].date; if (!startDate || !endDate) return [null]; const diff = daysBetween(new Date(startDate), new Date(endDate)); return [diff + 1]; }); function daysBetween(d1, d2) { const msInDay = 1000 * 60 * 60 * 24; return Math.floor((d2.getTime() - d1.getTime()) / msInDay); }