Printing directly from AppSheet or generating receipts on the fly isn’t straightforward. This guide walks you through integrating a custom, web-based receipt printing solution using a Virtual Column and the HYPERLINK() expression. The method sends receipt data to an external webpage for clean formatting and instant printing.
Features of This Solution
-
INSTANTLY generates printable receipts from AppSheet apps -
Supports both thermal (small) and A4 (full-page) formats -
Displays business logo (if available) -
Works seamlessly on mobile and desktop -
Automatically generates a PDF version on mobile devices -
The approach can be used to print anything from appsheet
Prerequisites
Before implementation, ensure your app has the following:
1. Receipt Data Table
-
Example: Order
-
Must include:
-
A key column (e.g., ID)
-
A receipt content column (e.g., Receipt) with plain-text formatted receipt data
-
2. User/Profile Table
-
Example: Users
-
Must include:
-
A column for the Business Logo Image URL (e.g., BusinessLogo)
-
A way to link the current user to their profile (e.g., UserEmail)
-
Setup Instructions
Step 1: Create a Slice (Optional but Recommended)
Create a slice from your Order table to isolate new or printable receipts:
-
Name it something like NewOrderReceipt
-
Include relevant columns: ID, Receipt, and any others needed
Step 2: Add a Virtual Column for the Print Link
How to Add It
-
Go to Data → Columns for the NewOrderReceipt table (or Order table if not using a slice)
-
Click “Add Virtual Column”
-
Name it: PrintLink
-
Set Type to: URL
-
Paste the following formula into the App Formula field:
HYPERLINK(
" https-://omorofos-wq.github.io/Receipt/sellebrety.html? " &
“search=” & ENCODEURL(ANY(SELECT(NewOrderReceipt[Receipt], [ID] = [_THISROW].[ID]))) &
“&logo=” & ENCODEURL(TEXT(ANY(SELECT(Users[BusinessLogo], [UserEmail] = ANY(Profile Personal Accounts[UserEmail]))))) &
“&app=” & ENCODEURL(CONTEXT(“AppName”)) &
“&id=” & ENCODEURL(CONTEXT(“AppId”)),
“Print Receipt”
)
NOTE: REMOVE THE “-” between https and ://omorofos IN THE " https-://omorofos
This creates a clickable link labeled “Print Receipt” that opens a web page with your receipt data.
Step 3: Understand the Formula Parameters
ENCODEURL() ensures special characters like spaces and line breaks are safely passed in the URL.
Key Data Preparation
Receipt Content (Receipt column)
-
Must be a single text block
-
Use expressions like CONCATENATE() and SUBSTITUTE() to format line breaks
-
Example output:
Sellebrety Store
Order #12345
------------------
Item A ₦500
Item B ₦300
Total ₦800
Thank you!
Logo Image (BusinessLogo column)
-
Must be a publicly accessible URL
-
Should not be too long
Displaying the Print Link in the App
Option 1: Show in Detail View
-
Go to UX → Views
-
Open the Detail View for NewOrderReceipt
-
Add PrintLink to the Column Order
-
It will appear as a clickable button
Option 2: Use an Action Button
-
Go to Behavior → Actions
-
Create a new Action:
-
For a record of this table: NewOrderReceipt
-
Action type: Go to a website
-
Target: [_THISROW].[PrintLink]
-
Do not enable —- open in a new window
-
-
Add this action to your desired view (e.g., inline, overlay, or prominently on the order screen)
Troubleshooting Tips
-
Ensure the Receipt column outputs are clean, readable text
-
Make sure logo URLs are valid, publicly accessible and not too long
-
Use slices to simplify logic and isolate printable records
-
You may contact me if you need more help