---
schema_version: "1"
id: 6f7bd8a013be735bda0bf6801cf8638963aadcfe33d4899e05edbcf35ed59f97
title: Customize Receipts Using Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/rt_cms_layouts_settings_receipt_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.rt_cms_layouts_settings_receipt_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 31c4dd81d521966fee3114d38ee107967ada16095b8cb72f9ac271642aff981e
description: Functions in Point of Sale receipt layouts dynamically display relevant information, improving clarity and reducing clutter. For instance, cash details are hidden for credit card payments, and employee discount info is omitted for non-employee sales, ensuring a cleaner, more user-friendly receipt.
products:
  - Commerce
release: "264"
---
# Customize Receipts Using Functions

Functions in Point of Sale receipt layouts dynamically display relevant information, improving clarity and reducing clutter. For instance, cash details are hidden for credit card payments, and employee discount info is omitted for non-employee sales, ensuring a cleaner, more user-friendly receipt.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col>
        <col>
        <col>
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d171581e36">Function</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d171581e39">Description</th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d171581e42">Example</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e36 "><code>=IF(expression,TrueOutput, FalseOutput) </code></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e39 ">If the expression is true, TrueOutput will be displayed otherwise FalseOutput
            will be displayed. Only "=" will be honored in the expression.</td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e42 "><code>=IF(:ps_p_fulfillment_type=Online,(S),(I))</code></td>

        </tr>
        <tr class="">
          <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e36 "><code>=DATEFORMAT(TimestampPSTag, DateFormat) </code></td>

          <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e39 ">
            <p>Timestamp PS Tags can configured to display a custom date format.</p>
            <div class="slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium">
              <div class="slds-media slds-media_responsive">
                <div class="slds-media__figure"><span class="slds-icon_container slds-icon_container_circle slds-icon-note-note"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-retail-264-0-0-production-enus/17d647fb-8988-49fb-9add-c4f4cc79c9e4/images/icon_note.png" alt="Note"></span></div>
                <div class="slds-media__body" style="padding-top:.5rem;padding-bottom:.5rem;"><span class="slds-text-title_caps">Note</span> The date format can have a maximum of 75 characters.</div>
              </div>
            </div>
            <p style="margin-bottom:0;">Supported: Modern POS &gt;= 8.1.1</p>
          </td>

          <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d171581e42 ">
            <p>To display the time with minute precision (e.g., "08/28/2024 10:01 AM") use the
              formula:</p>
            <p><code>=DATEFORMAT(:ps_order_time, MM/dd/yyyy hh:mm a)</code></p>
            <p>To display the time with second precision (e.g., "08/28/2024 10:01:38 AM"), use the
              formula:</p>
            <p style="margin-bottom:0;">
              <code>=DATEFORMAT(:ps_order_time,MM/dd/yyyy hh:mm:ss a)</code>
            </p>
          </td>

        </tr>
      </tbody>
    </table>

## Notes

- All content will be shown on the receipt as visibility of rows and cells cannot be toggled.
- There can only be one function per cell, functions cannot be chained together, i.e., `=IF(=DATEFORMAT(tag,format) == time, A, B)`
- Functions can only contain one PS tag at a time.
- Functions MUST be the only configuration for a given cell. They can not be mixed with text.
- If functions are not formatted correctly, the receipts will display an incorrect output or the raw input function.

## Functions For Truncations

Starting in POS version 9.2.1, when the `=IF` function returns an empty string, the receipt line will be truncated, thus removing the empty row where the `=IF` function result would have been. As of 9.2.1 this only applies to the Payment Tender receipt component.

For example, take the functions:

1. \=IF(:ps\_payment\_tender\_type=Gift Card,:ps\_gc\_tender\_balance,)
2. \=IF(:ps\_payment\_tender\_type=Cash,:ps\_cash\_tendered\_amount,)

![Example functions for determining the payment details to display on a receipt.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-retail-264-0-0-production-enus/17d647fb-8988-49fb-9add-c4f4cc79c9e4/retail/images/rt_cms_layouts_settings_receipts_tender_functions.png)

If an order is paid with cash:

- In the first function
    - The PS Tag, `:ps_payment_tender_type` in the expression `:ps_payment_tender_type=Gift Card` will be replaced with “Cash”.
    - As “Cash” does not equal “Gift Card” we will return the false output. False output is “” and since it is an empty string then the receipt line will be truncated and an empty space will not be rendered on the receipt.
- In the second function
    - The PS Tag, `:ps_payment_tender_type` in the expression `:ps_payment_tender_type=Cash` will be replaced with “Cash”.
    - As “Cash” does equal “Cash” we will return the true output.

To summarize, the configuration of the PS tags and functions determines the outcome. As the order was placed using cash as the payment method, the function `=IF(:ps_payment_tender_type=Gift Card,:ps_gc_tender_balance,)` yields a false output. On the other hand, the function `=IF(:ps_payment_tender_type=Cash,:ps_cash_tendered_amount,)` generates a true output. The following receipt example shows the gift card details are omitted and instead displays the relevant cash information, ensuring that no empty space is left on the receipt.

![Example receipt displaying details for a cash payment.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-retail-264-0-0-production-enus/17d647fb-8988-49fb-9add-c4f4cc79c9e4/retail/images/rt_cms_layouts_settings_receipts_tender_functions_result.png)

## Language and Functions

When operating in a non-English language, ensure that conditional selections are adjusted to match the language of the region. For instance, update "Gift Card" to "Carte cadeau" for the IF statement to align correctly.

- France
    - `=IF(:ps_payment_tender_type=Carte cadeau,Solde de carte cadeau,)` or
    - `=IF(:ps_payment_tender_type=Carte cadeau,:ps_gc_tender_balance,)`
- Mexico
    - `=IF(:ps_payment_tender_type=Efectivo,Monto Pagado en Efectivo,)` or
    - `=IF(:ps_payment_tender_type=Efectivo,:ps_cash_tendered_amount,)`

## Gift Card Balance & Serial Display for Gift Card Products

To display the Gift Card Balance & Serial Number for Gift Card Products only, use these functions:

- Gift Card Balance
    
    `=IF(:ps_p_id=<GC Product ID>,:ps_p_gc_balance,)`
- Gift Card Serial Number
    
    `=IF(:ps_p_id=<GC Product ID>,:ps_p_serial_num,)`

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-retail-264-0-0-production-enus/17d647fb-8988-49fb-9add-c4f4cc79c9e4/images/icon_note.png)

Note Ensure that 'GC Product ID' corresponds to the product ID configured in the CMS (**Integrations** > **Payment Gateway (Adyen)** > **Gift Card Settings** > **Gift Card SKU**).

For example, if the configured product ID is "GIFT CARD," the function should be:

`=IF(:ps_p_id=GIFT CARD,:ps_p_gc_balance,)`

![Example functions for modifying product details on a receipt.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-commerce-retail-264-0-0-production-enus/17d647fb-8988-49fb-9add-c4f4cc79c9e4/retail/images/rt_cms_layouts_settings_receipts_product_functions.png)

#### See Also

- [_Salesforce Help:_ Receipt Layouts](https://help.salesforce.com/s/articleView?id=commerce.rt_cms_layouts_templates_receipt.htm&release=264.0.0&type=5 "Customize Point of Sale receipts to enhance customer experiences. Configure store-level print receipts and use templates for order returns. The Receipt Layout editor allows you to tailor headers, footers, and item details. Understand common challenges and best practices for clear and readable receipts, including managing returns and exchanges.")