Requirement
Perform integration between Zoho Creator and Zoho Workdrive, and use
Schedules
to upload files from Creator to Workdrive on a monthly basis
.
Use Case
A project tracker app maintains report files of finished projects in a form - Projects. At the beginning of each month, report files of the projects completed in the previous month will be submitted for audit. To achieve this, a schedule will be run at the end of each month to create a new folder for the current month and push all the relevant project reports to the newly created folder
automatically.
Steps to follow
Form
|
Form Link Name
|
Field Type
|
Field Name
|
Field Link Name
|
Projects
|
Projects
|
Single Line
|
Company
|
Company
|
Single Line
|
Project title
|
Project_title
|
Single Line
|
Report
|
Report
|
This use case can be demonstrated using just the above-mentioned fields. You can include as many fields as required.
2. Create a
connection
with the following details.
This connection is used to authenticate the Zoho Workdrive account in which the files will be uploaded.
3. Create a
schedule
with the following details.
4. Click
Add New Action > Deluge Script
and add the following snippet:
- // Create a folder for the current month in Workdrive
- folder_name = "Audit_month-"+zoho.currenttime.getMonth();
- new_folder = zoho.workdrive.createFolder(folder_name, "oyw2o9aaeafa4c3e9421ca2ae4a8205d3c8c1", "workdrive_connection");
- // Fetch the ID of the new folder
- folder_id = new_folder.get("data").get("id");
- // Fetch the list of projects completed in current month
- projects_variable = Projects[End_date in this month];
- // Upload reports of the fetched projects to Zoho Workdrive
- for each rec in projects_variable
- {
- response = zoho.workdrive.uploadFile(rec.Report, folder_id, rec.Project_title, false, "workdrive_connection");
- }
See how it works