Solved: Generating Instant Web-based Printable Receipt In Appsheet Apps

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.

:sparkles: Features of This Solution

  • :white_check_mark: INSTANTLY generates printable receipts from AppSheet apps

  • :white_check_mark: Supports both thermal (small) and A4 (full-page) formats

  • :white_check_mark: Displays business logo (if available)

  • :white_check_mark: Works seamlessly on mobile and desktop

  • :white_check_mark: Automatically generates a PDF version on mobile devices

  • :white_check_mark: The approach can be used to print anything from appsheet

:toolbox: 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)

:gear: 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

:wrench: How to Add It

  1. Go to Data → Columns for the NewOrderReceipt table (or Order table if not using a slice)

  2. Click “Add Virtual Column”

  3. Name it: PrintLink

  4. Set Type to: URL

  5. 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

:white_check_mark: 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.

:receipt: Key Data Preparation

:white_check_mark: 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!

:white_check_mark: Logo Image (BusinessLogo column)

:desktop_computer: 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)

:sos_button: 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

3 Likes