Retrieve individual Records from Zoho Subscriptions
Using zoho.subscriptions.retrieve() Deluge task in Zoho Creator, you can fetch individual records, one at a time, from supported modules of Zoho Subscriptions. You can make use of different workflow options in Zoho Creator to automate this process . Fetch individual customer details, transaction details, subscription details etc., as and when you need to, using this task. For example, you can execute "form actions" in Zoho Creator to fetch a particular customer's details or any specific subscription details of a customer.
- Hosted Pages
<response> = zoho.subscriptions.retrieve(<module>, <orgID>, <ID> );
<response> is the map variable returned as response. It contains the details of the fetched record.
<module> is the name of the Zoho Subscriptions Module from where the record needs to be fetched. For example, "Customers" refers to the Customers module.
<orgID> refers to your organization ID as specified in Zoho Subscriptions. To know your organization ID, click on <YourOrganizationName> > Manage Organizations, from the top-right corner of your Zoho Subscriptions Home page. Click here to learn more about Org ID.
<ID> refers to the ID of the record you want to fetch.
- All the parameters listed above are mandatory.
1) Retrieve a record from Hosted Pages module of Zoho Subscriptions
In this example, we will fetch a record from the Hosted Pages module by adding code to a Zoho Creator form and submitting the form. The form consists of field "Record ID". Upon submission of the form, the specified record gets retrieved from Zoho Subscriptions using the data submitted.
- Add the following scipt in the "on Success" section of your Zoho Creator form
response = zoho.subscriptions.retrieve("hostedpages", "12345678", input.Record_ID);
- Submitting the form will fetch the specified record from the specified module and orgID.
"hostedpages" and "12345678" refer to the module name and org ID respectively.
input.Record_ID refers to the Zoho Creator form field.
Following is the response format returned by Zoho Subscriptions to Zoho Creator:
If for some reason, the execution fails, the error response will be in the following format:
Error Response for - Invalid Record ID