Introduction
Online ordering has become a cornerstone for small businesses, freelancers, and educators who need a simple, cost‑effective way to collect payments. While e‑commerce platforms offer full‑featured carts, many creators prefer the lightweight flexibility of Google Forms. By combining Google Forms with Google Sheets, Apps Script, and a dynamic UPI QR code, you can turn a plain questionnaire into a complete order‑to‑payment workflow. This article walks you through every step: building a form that captures product selections, automatically computing the total amount, generating a personalized UPI QR code, and delivering it to the customer for instant payment. Whether you sell handmade crafts, digital services, or event tickets, the method outlined here requires no additional subscription and works on any device that supports UPI.
Designing the Order Form – Items, Prices, and Options
Start by creating a Google Form that mirrors your catalogue. Use multiple‑choice or checkbox fields for each product category, and add a short‑answer field for quantities when needed. To keep pricing transparent, include the unit price in the option text, for example, “Canvas Print – ₹250”. This approach lets the respondent see costs upfront while keeping the form tidy. Remember to:
- Group related items under section headers for better navigation.
- Enable “required” answers for essential selections to avoid incomplete orders.
- Use the “Go to section based on answer” feature if you need conditional flows (e.g., different accessories for different product lines).
When the form is submitted, every response is automatically stored in a linked Google Sheet, providing the raw data you’ll later transform into a bill.
Linking the Form to a Spreadsheet and Adding Real‑Time Calculations
Open the response spreadsheet and add helper columns that extract numeric values from the option text. A simple =VALUE(REGEXEXTRACT(B2, "\d+")) formula pulls the price, while another column multiplies it by the quantity entered. To calculate the total amount for each order, sum the line‑item totals with =SUM(C2:F2) (adjust the range to match your columns). For a fully automated experience, write a short Apps Script trigger that runs on form submission:
- Step 1: Retrieve the newly added row.
- Step 2: Parse each selected item, extract its price, and compute the line total.
- Step 3: Write the grand total back to a dedicated “Total” column.
This script ensures the bill amount is always accurate, even if you later adjust prices in the form.
Creating a Custom UPI QR Code with Apps Script
UPI QR codes follow a standard URI format: upi://pay?pa=VPA&pn=Name&am=Amount&cu=INR. In the same Apps Script file, add a function that builds this URI using the payer’s VPA (your merchant UPI ID), the calculated total, and an optional transaction reference. Then, call the Google Chart API to generate the QR image:
var uri = `upi://pay?pa=${merchantVPA}&pn=${merchantName}&am=${total}&cu=INR`;var qrUrl = `https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=${encodeURIComponent(uri)}`;
The script writes the QR URL into a new column of the response sheet. Because the QR is built per row, each customer receives a unique code that reflects their exact order amount.
Embedding the QR Code in the Confirmation Message and Optimising the Flow
Finally, send the QR code back to the customer. You have two reliable options:
- Email notification: Use the
MailApp.sendEmail()method to attach the QR image (or its link) and a short receipt that lists the ordered items and total. - On‑screen confirmation: Create a Google Form “Thank you” page that displays the QR image via the
IMAGE()function in a cell, then embed that cell in the response sheet’s “View response” link.
For a smoother experience, add a note reminding the payer to capture the screenshot of the QR for future reference, and include a fallback payment link (e.g., a short UPI deep link) in case the QR fails to scan. Testing the entire flow on both Android and iOS devices ensures the QR renders correctly across popular UPI apps.
Conclusion
By leveraging the native integration between Google Forms, Sheets, and Apps Script, you can transform a simple questionnaire into a fully automated UPI payment gateway. The process begins with a well‑structured order form, continues with real‑time price calculations in a spreadsheet, proceeds to the generation of a custom UPI QR code, and ends with a clear, instant payment option for the customer. This solution eliminates the need for costly third‑party cart systems, offers complete control over branding, and works on any device that supports UPI. Implement the steps outlined above, adapt them to your product range, and you’ll have a reliable, low‑overhead ordering system that speeds up transactions and improves customer satisfaction.








