Follow steps below to configure updates from Mapsly to your Zoho Creator app
1. Connect Zoho Creator to Mapsly
This guide assumes that you already have connected Zoho Creator by importing a data source to Mapsly. If you haven't done so already, please follow this guide.
2. Obtain refresh token
First, you need to obtain a refresh token. To get one, you need to visit Zoho API Console.
There, you need to add client (if you don't have it already) and add scope for your application. You can find Zoho Creator scopes here, but in our example we will be using the following scope:
ZohoCreator.form.CREATE,ZohoCreator.report.CREATE,ZohoCreator.report.READ,ZohoCreator.report.UPDATE,ZohoCreator.report.DELETE
after that click "Create" to generate a 10-minute authorisation code.
Then, Send a POST request to:
In the URL parameters you need to add the following parameters:
code: here you need to paste your code that we generated previously
client_id - here you need to paste your client id
client_secret - here you need to paste your client secret
grant_type: authorization_code
In the response you will find the refresh token, which we will use in the next step:
3. Configure Refresh access token request
Then, you need to configure the Refresh access token request which will be invoked every time a create/update workflow is triggered. This request will return access token which will then be used in the workflow.
To do that, simply go to Mapsly > Setup > Actions > create Invoke URL action:
Name your Invoke URL action, choose Method: POST, Content Type: JSON. Target URL has to be in the form of:
Important! Depending on your Accounts instance, you may have a different domain. To know exactly what domain you have please log in to your Zoho Accounts and check the URL in the address bar.
In the URL parameters you need to add the following parameters:
refresh_token: here you need to paste your refresh token
client_id - here you need to paste your client id
client_secret - here you need to paste your client secret
grant_type: refresh_token
Once everything is filled in, click on "Save":
4. Configure Lead created workflow
In this example, we will be configuring the workflow when a Lead record is created in Mapsly.
First, you need to create a workflow by going to Setup > Workflows > Create a workflow:
Name your workflow, choose Trigger: Created. Then click to add existing action and choose the Invoke URL action that we have created earlier:
Now, you need to create another action that will actually push the created Lead to Zoho Creator form. To do that click on "Create new action" and choose "Invoke URL" action:
Name your action, choose Method: POST, Content Type: JSON. Target URL has to be in the following format:
where <account_owner_name> in our case is sampleco, <app_link_name> is mapsly-demo and <form_link_name> is Contact. You can find each of these for your application simply by opening the application and looking at the URL:
In the Header parameters you need to add Authorization: Zoho-oauthtoken {{lastAction.response.access_token}}
In the end you should end up having a request like this:
Then, you need to add the body to your request which will contain the fields of created record. Here is an example of such body:
{
"data": {
"Email": "{{record.email}}",
"Phone_Number": "{{record.phone_number}}",
"Name": {
"first_name": "{{record.first_name}}",
"last_name": "{{record.last_name}}"
},
"Address": {
"address_line_1": "{{record.address_line_1}}",
"address_line_2": "{{record.address_line_2}}",
"district_city": "{{record.city}}",
"state_province": "{{record.state}}",
"postal_Code": "{{record.postal_code}}",
"country": "{{record.country}}"
}
}
}
Here, were are mapping Zoho Creator fields with Mapsly fields and you can map any other field that you would like to be pushed to Zoho Creator.
After that, you need to create an Update record action:
You need to choose the Zoho ID field and the Target value should be {{lastAction.response.data.ID}}. It should look like this:
5. Configure Lead updated workflow
Similar to the "Lead created" workflow, we need to create a "Lead updated" workflow. Choose the Trigger: Updated, and add the "Refresh access token" action. Then, create "Update lead in Zoho Creator" action (instructions below):
Name the new action, choose Method: PATCH, Content Type: JSON. Target URL has to be in the following format:
This is the same URL as in the previous workflow, except here you need to replace <record_ID> with {{record.zoho_id}}, which is the field that stores the Zoho ID of the record.
Once, again set the Authorization header parameter and body similar to like we did in the previous workflow. You should end up having action like this:
Once finished, click Save to save the Invoke URL action and the workflow.