Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Aug 20, 2020 09:42 AM
I am looking for a script to insert the current date and time into a field when you hit a button.
Currently, my users just hit the “Today” button when the calendar pops up in the date-time field when they begin a task but I would like to just have a “Start Task” button.
I am new to scripting and would appreciate it if someone could walk me through this first application.
Jun 13, 2022 01:57 PM
Is it possible to tweak this a hair and have it add seven days to todays date and set the new date to that?
Jun 13, 2022 06:54 PM
@Michael_Ali1 You could just replace the last three lines of the original script with the following four:
let record = await input.recordAsync('Record to timestamp', config.tableToUse)
let newDateTime = new Date();
newDateTime.setDate(newDateTime.getDate() + 7);
await config.tableToUse.updateRecordAsync(record, { [config.timeStampField.name]: newDateTime })
Jun 14, 2022 09:34 AM
Thats perfect. Thanks!