Using Zoho CRM API, how can I update a file_upload field to link to a WorkDrive folder?
I have a deluge script that automatically creates a WorkDrive folder when a new record is added to a custom module.
This is working fine.
Inside this custom module, I have a field called 'Work Drive'. I want to update this field to link over to the newly created WorkDrive folder. I cannot find any way to do this automatically using the API.
In the screenshot below, you can see I am able to upload an image to the File Upload field using the API.
Unfortunately, when I try to upload a WorkDrive file in the same way I get the following error: "Data type of the argument of the function 'setParamName' did not match the required data type of '[FILE]'". Below is the code I am using. Replace XXX with my folder ID.
- fileVariable = invokeurl
- [
- url: "https://workdrive.zoho.com/folder/xxx"
- type: GET
- ];
- fileVariable.setParamName("file");
- response = invokeurl
- [
- url :"https://www.zohoapis.com/crm/v7/files"
- type :POST
- files: fileVariable
- connection:"zohofiles"
- ];
- info response;
I understand I can download the WorkDrive then upload it, but I want it function like the integration so that when I click on the link it takes me straight to the WorkDrive file, like how 'Non-Confidential' is below: