How to Use a Variable?
To use variables, ensure the fields providing the variable values are available in the context where the Query is executed.
Let’s say you want to evaluate a marketing campaign's performance. For this, you need to fetch all leads with a specific lead source. Since each campaign is associated with a different lead source, you can define the lead source as a variable. When viewing a campaign's details, the lead source will be passed dynamically to the Query.
Business Scenario : Nearby Delivery Hubs
Imagine a telecommerce platform using Zoho CRM to manage sales and deliveries. When a customer provides their PIN code, the salesperson must confirm with the customer for a nearby post office for package pick-ups and drop-offs in Kiosk.
With Zoho CRM Queries, you can achieve this by dynamically fetching the nearby post offices list based on the customer's PIN code and displaying it on the Contact record’s detail page. Here's how to set it up using the Kiosk feature.
Setting Up the Query in Kiosk
1. Access Kiosk Studio
- Log in to Zoho CRM.
- Go to Setup > Customization > Kiosk Studio and click Create Kiosk.
2. Configure the Current Module
- Choose the module where the Kiosk will be deployed.
For this example, select Contacts to use the PIN code from the Contact record.

- Configuring this Current Module is mandatory to use variables from the current record.
3. Add a Screen
- Click the + icon on the flowchart and select Screen.
- Name the screen and click Add.

4. Add a Query
- Under Display Elements, choose Get Data Via Queries.
- Click New Query and then Add Query to create a new one.

5. Set Up the Data Source
- Any custom source has to be enrolled either in the Trusted Domains or in the Connections. For demo,
- In the Add Query pop-up, click Source and create a new source.
For this demo, we’ll add India Post to fetch post offices based on PIN codes.

- Add default Headers and Parameters to the source if any. This will be added by default whenever the source is used in a query.
6. Define the Query
- In the Information section, provide the query’s Name and API Name to refer to the query wherever needed.
- Use the endpoint URL with a variable, e.g., https://api.example.com/post_offices/{{Mailing_Zip}}.
- You can add headers and parameters specific to the query, but let us skip that for the demo.
- Add a JavaScript serializer to process the Query response. For our case, we will serialize the response with return result[0].PostOffice;.

- You can test your serializer with the help of Preview. Once finished, provide a test value to the variable for generating Schema for the Query Response.
The test value you provide is temporary and not permanent. The value of a variable will be declared using merge fields when you associate the query with a component. Check Step 7 to know how it is used in our demo.
You can also manipulate the response by changing data types of keys in the raw response. To keep the demo simple, let's go with the raw response.

7. Link the Query to Kiosk
- Use Dynamic Parameters to map the variable to the Mailing Zip field from the Contact record. Enter # to merge the fields.
- In Choose Fields, select which data to display in the Kiosk.

- You can further manipulate the query response in the Record Preferences section.
Select your preference to view the response as a Single Record or Multiple Records. - For Single Record, choose the data that has to be displayed from the query response and click Save.
- For Multiple Records, fill in the following details as shown in this image.