How to request UPI payments through Google Forms

The customer places an order through Google Forms and the bill amount is automatically calculated based on the items selected. A customized UPI QR code is generated to make the payment.

Cake Studio is a local bakery that accepts orders through Google Forms. When a customer places an order, the customer automatically receives a UPI QR code to make the payment. This QR code is dynamically generated based on the order amount and the customer can pay the bill using any UPI app.


In the screenshot above, the customer ordered a butterscotch cake through Google Forms and they received a customized UPI QR code containing the exact amount of the bill. The amount is automatically calculated based on the items selected in the Google Form.

Google Forms and UPI Payments

This tutorial explains how you can send custom UPI QR codes to customers when they order through Google Forms. We’ll use Google Sheets to calculate bill amounts and generate QR codes, and Document Studio to send emails with QR codes to customers.

Let’s see how you set up this workflow in a few simple steps.

Prepare a Google Form for orders

Here is a sample Google Form we created for Cake Studio. You can see, and This is importantWe have mentioned the quantity of each cake in the options itself.

Create a Google Sheet

Open a Google Sheet with a link to a Google Form. A Google Sheet contains columns for questions in a Google Form. We will now add extract columns that will help us generate custom UPI QR codes.

You can find a Google Sheet with UPI Formulas here

Add columns to a Google Sheet

1. Bill amount – This column will store the price of the cake ordered by the customer. We will write the formula using REGEXREPLACE Function to extract the value from the selected option.

=ARRAYFORMULA(IF(ROW(D:D)=1,"Bill Amount",
  IF(NOT(ISBLANK(D:D)),REGEXREPLACE(D:D,".+₹ ",""),)))

2. Total amount – Our second column will store the total bill amount which adds GST to the price of the cake. We will use Arrayformula to apply the calculation to the entire column.

=ARRAYFORMULA(IF(ROW(E:E)=1,"Total Amount",
  IF(NOT(ISBLANK(E:E)), E:E * 1.18,)))

3. UPI QR Code – The last column will store a custom UPI QR code that contains the total bill amount. We will use the built-in UPI function to generate the QR code.

A customized UPI QR code will be generated for each order. The QR code will contain the total amount of the bill so that the customer can pay without manually entering the amount.

Embed UPI QR codes in email

Now that we have the UPI QR codes in the Google Sheet, we’ll use Document Studio to send emails to customers with the QR codes embedded in the body of the email.

Launch Docs Studio in your Google Sheets and create a new workflow. Add one Send Email Work in a workflow. Create a message template that includes an embed image marker to embed a UPI QR code in an email.

{{Embed IMAGE, UPI QR Code}}

We have mentioned the UPI QR code as the second parameter in the above marker because it is the heading of the column containing the generated QR codes in our Google Sheet.

Save the workflow and make sure to enable it Run on Form Submit Emails are automatically sent when a new order is placed via Google Forms.

Test the UPI payment workflow

Fill out this Google Form and you should see a new row added to this Google Sheet with the bill amount and UPI QR code. You will also receive an email with the UPI QR code embedded in the body of the email.

Leave a Comment