It looks like you want to specify the due date for a task using a date field on the source report.
For that, you can use dueDate instead of days in the events.
Here is the reference document you can follow to understand how to use dueDate:
Here are some examples of dueDate being used in tasks:
It looks like CHT has encountered a problem when running the Utils.addDate function.
Although it might not be the cause of the error above, the function requires two arguments:
a date to start with
the number of days to add
You are providing only the first argument i.e. nextVisitDate.
Also, please make sure that nextVisitDate is a valid JS Date.
You are probably getting a string from the report in a format similar to 2023-11-28. You need to convert it into JS date:
const nextVisitDate = Utils.getField(report, 'g4.q36_next_visit_date');
//optional: check in browser log that you are getting the correct date
console.log('next visit': nextVisitDate); //remove later
const nextVisitDateJS = new Date(nextVisitDate);
return nextVisitDateJS;
You might have more details about the error in the browser console. Please check.