Add Email, Name to Zoho Creator from Zoho CRM

This puzzled me for a while because Zoho Creator treats the ‘Name’ field as a single field, but CRM has ‘First Name’ and ‘Last Name’. The trick was to specify them – thanks to the support Team at ZPortals for the tip!

Background
We have a form called ‘Employee Setup Form’ in our portal, and we want to automatically pre-fill the Email address and Name of the person filling out the form. This should be easy because the person is already logged in, right?

It turns out that you can make a functional URL by adding variables on at the end as explained in this article, but the format is like this-

https://PermalinkOfYourCreatorApp/?Your_Email=email@company.com&Your_Name.first_name=FirstName&Your_Name.last_name=LastName

(remember above has to be url encoded)

Zoho themselves supplied this code, but you have to make a custom function etc. and it just seemed it should be a bit easier.
Summary- the code gets the required variables and then constructs a custom URL based on the variables. in this example the final output is called ‘url’

response = zoho.crm.getRecordById("Contacts", YourContactID);
first_name = response.get("First_Name");
last_name = response.get("Last_Name");
email_address = response.get("Email");
encoded_first_name = url.encode(first_name);
encoded_last_name = url.encode(last_name);
encoded_email_address = url.encode(email_address);
url_suffix = "first_name=" + encoded_first_name + "&last_name=" + encoded_last_name + "&email=" + encoded_email_address;
url = "https://PermalinkOfYourCreatorApp/?Email="+encodeurl(response.getJson("Email"))+"&First_Name="+encodeurl(response.getJson("First_Name"))+"&Last_Name="+encodeurl(response.getJson("Last_Name"))+"";

Then I discovered that in Zoho CRM you can add custom URLs to the Contacts module sidebar under ‘Links’. you can see I’ve added a link called ‘zPortalsForms’ in the pic below-

So we can add the link to the creator form, add a couple of variables and Bob’s your monkeys Aunt? Well yeah, but no. But yeah.

That ‘zPortalsForms’ link does not appear in zPortals, so we can’t use it.

The key is to get the syntax to address the Creator ‘Name’ field. Mine is called ‘Your_Name’ and the whole URL looks like this-

https://creatorapp.zohopublic.com/CompanyName/CreatorAppName/form-perma/FormName/FormPermaLink/?Your_Email=${Contacts.Email}&Your_Name.first_name=${contacts.First_Name}&Your_Name.last_name=${contacts.Last_Name}

Breaking this down, the bit we are interested in is –

Your_Email=${Contacts.Email}&Your_Name.first_name=${contacts.First_Name}&Your_Name.last_name=${contacts.Last_Name}

And further separating these for readability (delete ‘&’ because it simply joins the variables) yields-

Your_Email=${Contacts.Email}
Your_Name.first_name=${contacts.First_Name}
Your_Name.last_name=${contacts.Last_Name}

The Answer

So there it is- you just have to address the fields as ‘Your_Name.first_name’ and ‘Your_Name.last_name’.

Recent posts