Get Merge Fields from Zoho Writer
Table of Contents
Note:
- Each time the zoho.writer.getMergeFields integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.writer.getMergeFields integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Description
The zoho.writer.getMergeFields task is used to list all the merge fields inserted into a Zoho Writer document. This integration task is based on the Zoho Writer API - Get All Fields.
Syntax
<response> = zoho.writer.getMergeFields(<document_id>, <connection>);
where:
| Params | Data type | Description |
| <response> | KEY-VALUE | The response returned by Zoho Writer. It represents the list of merge fields inserted into the specified document. |
| <document_id> | TEXT | The ID of the document from which the merge fields need to be fetched. The document ID can be obtained from the URL of the document from which the merge fields need to be fetched. The URL is in the following format: |
| <connection> | TEXT | The link name of the connection. Note:
|
Example
The following script fetches the list of merge fields inserted into the specified document.
response = zoho.writer.getMergeFields("al296XXXXXXXXXXXXXXXXXXXXXXXXXXXa516c", "writer_oauth_connection");
where:
response"al296XXXXXXXXXXXXXXXXXXXXXXXXXXXa516c""writer_oauth_connection"Response Format
Success Response:
The success response will be returned in the following format:
{
{
"rl_fields":[],
"fields":["Start Time","End Time","Event Title","Location","Contact Email"]
}
Failure Response
The failure response for improper document ID will be returned in the following format:
{
"error": { "message": "Request URL not configured properly. Please check and try again",
"documentation_url": "https://www.zoho.com/writer/help/api/v1/general-errors.html",
"response_generated_time": 1563961624177,
"request_url": "https://writer.zoho.com/api/v1/documents//collaboration",
"errorcode": "R2008"
}
}The failure response when you try to fetch merge fields from a document that you do not have permission will be returned in the following format:
{
"error": {
"message": "Permission denied. You are not authorized to perform this operation.",
"documentation_url": "https://www.zoho.com/writer/help/api/v1/general-errors.html",
"response_generated_time": 1563961602526,
"request_url": "https://writer.zoho.com/api/v1/documents/al296XXXXXXXXXXXXXXXXXXXXXXXX6964add/collaboration",
"errorcode": "R5010"
}
}