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, endDate] if (!startDate || !startDate.date || !endDate || !endDate.date) return null; const diff = daysBetween(new Date(startDate.date), new Date(endDate.date)); return diff + 1; }); function daysBetween(d1, d2) { const msInDay = 1000 * 60 * 60 * 24; return Math.floor((d2.getTime() - d1.getTime()) / msInDay); }