Many businesses aim to automate the gathering and storing of crucial data in a CRM record. This can simplify workflows, guarantee data accuracy and up-to-date information, and save time—a critical factor in making informed business decisions. Additionally, it can enhance the overall customer experience by equipping your salespeople with the necessary information to deliver personalized and effective service.
To accomplish this task, you will need to call an endpoint that will provide data for you to convert into a file and save onto a CRM record. Our low-code tools in CRM can assist you with this process. Continue reading to discover how to retrieve information, transform it into a file, and store it into a contact record in under 15 minutes.
Permissions and availability
- Users with the Manage Extensibility permission can write custom functions.
- Users with the Manage Sandbox permission can manage the sandbox.
Requirements
- Write a standalone custom function using the provided code snippet. Learn more
- Test the function in a sandbox environment before deploying it to your production environment. Learn more
Write a Custom Function
The first step is to write the standalone custom function that retrieves information, transforms it into a file, and stores it into a contact record as an attachment.
- Navigate to Setup > Developer Space > Functions > +New Function.
- Provide a name and display name for the function. For example: "Attach Contact Information".
- Select the category of the function as Standalone.
- Copy and paste the code provided below.
- Click Save.
The code
//Get the contact's information from an URL For example, if you wish to fetch the company details of a contact, enter their website URL here
urlToCall = "https://website.com/";
//Transform the response as a file
Response = invokeurl
[
url :urlToCall
type :GET
response-format:FILE
];
//Enter the name for the attached file
Response.setFileName("File Name");
//Enter the ID of the corresponding contact record
info zoho.crm.attachFile("Contacts","ContactId",Response);
return "success";
Notes
- Make sure to use the accurate API names for their corresponding fields in the code snippet. Learn more
- The script above is an example of retrieving information from a URL, transforming it into a file, and storing it as an attachment in the contact record. You can customize this code to attach files in other modules, such as accounts, by changing the module name and other parameters.
Test the solution
- Go to the Contacts module and click on the desired contact.
- On the contact details page, copy the unique ID assigned to the contact from its URL.
- Replace "ContactId" with the copied ID in the code snippet.
- Replace the URL to call with the required URL.
- Enter a name for the file to be attached to the contact.
- Click the Save & Execute button.
It will retrieve information from the entered URL, transforms it into a file, and stores it as an attachment in the contact record.
Did you find this useful? Try it out and let us know how it works. Share this with your team if they'd benefit from it! If you have questions, please don't hesitate to contact us.
More info
- ModuleContacts
- Trigger PointManual
- EditionEnterprise and above
- ComplexityEasy
- Implementation Time15 minutes

Looking for a custom solution?
Contact us, we will help enhance your productivity at lightning speed.
SUBMIT REQUEST