How to Send Weekly Scheduled Emails of a Custom View
Greetings,
We have a custom view called "All Employee View" for the Employee form.
We are able to manually export that view using the "Export" button:
However, we want to programmatically export this view as an XLS file each week and send it in an email attachment. For this, I tried the following Scheduler Deluge code, but the viewId part to get the data as in the custom view is not working.
- report = Map();
- report = zoho.people.getRecords("P_Employee",0,200,{"cvid":"<viewId from the URL>"});
- myfile = report.toFile("myfile.csv");
- sendmail
- [
- from :zoho.loginuserid
- to :"<myemail>"
- subject :"test"
- message :report
- Attachments :file:myfile
- ]
Please let me know if I am on the right track.
Thanks.