How to Use GPT & Set of Variables to Make Enquiries About Products
This tutorial will show you how to combine global variables with GPT functionality in Pingstreams to create an intelligent product inquiry system that can answer customer questions about pricing and product details.
Step 1: Create Global Variables
Section titled “Step 1: Create Global Variables”First, select “Globals” from the left sidebar menu in your Pingstreams dashboard.
Then, add a new global variable, as shown in the image below:

Step 2: Configure Your Price List
Section titled “Step 2: Configure Your Price List”Next, choose a Key for your variables and input your price list in the Value section.
See the example configuration below:

Step 3: Design the Bot Flow
Section titled “Step 3: Design the Bot Flow”Now, return to the Blocks section to design the bot.
You’ll need an action called “Capture User Reply” to capture the customer’s response. You can assign an attribute to it. In this case, we used ‘UserReply’ as the attribute:

Step 4: Configure the ChatGPT Task
Section titled “Step 4: Configure the ChatGPT Task”For the next block, use the ‘ChatGPT Task’ action.
You can see the prompt that includes the Global’s attribute created earlier under ‘pricetable’. Getting the perfect prompt might require a few attempts to get it just right:

Step 5: Add the Reply Block
Section titled “Step 5: Add the Reply Block”Finally, add a new reply block and simply choose the gpt_reply attribute:

Demo: Bot in Action
Section titled “Demo: Bot in Action”That’s it! In the demonstration below, you can see how the bot finds the price in the table and shares it with the user:

How It Works
Section titled “How It Works”The system works by:
- Storing product data in global variables that can be accessed throughout the bot flow
- Capturing user queries about products or pricing
- Using GPT to intelligently parse the user’s request and match it against the stored product data
- Providing accurate responses based on the information in your price table
Benefits of This Approach
Section titled “Benefits of This Approach”This method offers several advantages:
- Dynamic pricing updates: Easily update prices in global variables without changing the bot flow
- Flexible queries: Users can ask questions in natural language
- Accurate responses: GPT intelligently matches user queries to your product data
- Scalable solution: Add more products and information as needed
- Cost-effective: No need for external database connections for simple product catalogs
Use Cases
Section titled “Use Cases”This system is perfect for:
- E-commerce product inquiries
- Service pricing information
- Restaurant menu and pricing
- Course or training program costs
- Subscription plan details
- Product specification queries
Advanced Tips
Section titled “Advanced Tips”To enhance this system further:
- Add multiple global variables for different types of product information (specifications, availability, etc.)
- Use structured data formats like JSON in your global variables for complex product catalogs
- Implement conditional logic to handle different types of queries
- Create specialized prompts for different product categories
- Add follow-up questions to help users find exactly what they need
Sample Prompt Structure
Section titled “Sample Prompt Structure”Here’s an example prompt structure for the ChatGPT Task:
You are a helpful product assistant. Use the following product information to answer customer questions:
{{pricetable}}
Customer question: {{UserReply}}
Please provide a helpful and accurate response based on the product information above. If the requested item is not available, suggest similar alternatives if possible.This combination of global variables and GPT creates a powerful, flexible system for handling product inquiries in Pingstreams, providing customers with accurate, real-time information about your products and services.
Cheers, The Pingstreams Team