1. Create a Lead Form in Zoho Creator:
-
Company Name (field type - Single Line)
-
Name (field type - Single Line)
-
Telephone (field type - Single Line)
-
Email Address (field type - Email)
-
File Upload field (for adding attachments)
2. Write the script:
Go to the
On Add -> On Success
section of the above Form and navigate to Free flow script builder (See this
image
pointer 7
).
2.1. Create the CRM vs Creator fields map:
It is important to set up the field mapping for the Zoho Creator system to push data to the right fields on the CRM module. Sample below. Final script is given at the end of the article.
//add values to the map. CRM fields first and then Creator fields (
without the quotes
). Creator field's
deluge name
is used here.
myFieldMap.put("Company", Company_Name);
//note that in the above line, Company is the CRM field and Company_Name is the Creator field
myFieldMap.put("Last Name", Name);
myFieldMap.put("Phone", Telephone);
myFieldMap.put("Email", Email_Address);
Update
: Adding attachments is supported too. Script syntax is,
myFieldMap.put("Attachment" , input.File_upload);
Note : Keyword Attachment is used for file upload field. Refer to this response
2.2. Write the function to push data to CRM:
The syntax of the function that pushes data to CRM from Creator looks like below.
response = zoho.crm.create(
CRM Module Name
,
Fields map
);
2.2.1 Function explanation:
1. zoho.crm.create() is the function that tells Zoho Creator system to add new record in CRM.
2. CRM Module Name and the Fields map (refer to section 2.1) are passed to the function to make sure the right record is added to the right module.
3. Response stores the result of the action (success or failure with the record ID of the CRM module).
2.2.2 Example script (continued)
According to our example, the below script should be written at the end of the script given at (section 2.1).
response = zoho.crm.create("Leads", myFieldMap);
So the final script will be
myFieldMap = map();
myFieldMap.put("Company", Company_Name);
myFieldMap.put("Last Name", Name);
myFieldMap.put("Phone", Telephone);
myFieldMap.put("Email", Email_Address);
myFieldMap.put("Attachment" , input.File_upload);
response = zoho.crm.create("Leads", myFieldMap);
Click on Save Script.
Submit data on your Creator Form and check the lead in CRM.
Note
: This article captures only 5 basic fields from CRM Leads module. You can use other fields in the same method too.
References: