Flow Automation: Finding Gift Cards via Action
You can use the Find gift cards action in Flow Automation to find all gift cards in your store that match conditions such as status, creation time, and expiration time in a single step, and pass them to later steps in the workflow. For example, you can find gift cards that are about to expire and remind your customer service team to follow up with customers.
This guide explains when to use this action, its field descriptions, the applicable workflows, and how to test it, and provides a practical example along with usage limits.
| Note: This action only queries gift card information. It does not change a gift card's balance, status, or expiration time. For more details on managing gift cards, please refer to "Creating and Managing Gift Cards." |
When to Use the Find Gift Cards Action
Use the Find gift cards action when:
- You want to find gift cards that still have a balance before they expire, so your customer service team can remind customers to use them.
- You need to find gift cards created within a specific period for reconciliation or campaign reviews.
- You need a list of gift cards to process one by one with a For each loop (iterate) step.
Field Descriptions
The Find gift cards action allows you to add query conditions to define which gift cards to query.
| Field | Description |
| Query conditions | Filters the gift cards to query. Click + Add condition, select the conditions you need, and click Sure. Then enter the corresponding values, or click + Add variable to use a parameter from a previous step. If no conditions are added, the action queries all gift cards in your store and returns up to 50 gift cards by default. The following conditions are supported:
|
| Note: For each gift card found, you can click + Add variable in later steps to use the following information: [last_characters], [initial_value], [balance], [currency], [expires_on], [created_at], [note], [order_ID], [customer_ID], [nickname], [email], and [message]. |
Applicable Workflows
The Find gift cards action is primarily used in workflows initiated by the following trigger:
- Scheduled time
Testing the Workflow
To test whether the workflow successfully queries gift cards, follow these steps:
From your SHOPLINE admin panel, go to Products > Gift cards and make sure your store has at least one enabled gift card. If not, create one first.
Note: For details on creating gift cards, please refer to "Creating and Managing Gift Cards." - In Flow Automation, set up a workflow using the Scheduled time trigger and the Find gift cards action. Set the trigger's First trigger time to a few minutes from now, and set Repeat or not to Not repeating.
- In the Find gift cards action, add the status condition, enter enabled, and then click Publish.
After the first trigger time is reached, go to Flow Automation to check the execution results.
Note: For more information on how to monitor the execution of your workflows, refer to the "How to View the Running of a Flow" section in the "Introduction to Flow Automation" guide. - Open the workflow's run details and confirm that the Find gift cards action returned the enabled gift cards in your store.
Example Use Case
Here is a practical example of using the Find gift cards action to remind your customer service team to follow up on gift cards that are about to expire.
Scenario: On December 1, find all enabled gift cards that expire in December. For each gift card that still has a balance, send an email to your customer service team so they can contact the customer and remind them to use it.
- Trigger: Scheduled time
- First trigger time: 2026-12-01 09:00:00
- Repeat or not: Not repeating
- Action: Find gift cards
- status: enabled
- expires_on_min: 2026-12-01T00:00:00+08:00
- expires_on_max: 2026-12-31T23:59:59+08:00
- Action: For each loop (iterate) (runs the following steps for each gift card found)
- Condition: [balance] is not equal to 0.
- Action: Send email
- Subject: Gift Card Expiring Soon: Ending in [last_characters]
- Content: The gift card ending in [last_characters] has an unused balance of [balance] [currency] and will expire on [expires_on]. Recipient: [nickname] ([email]). Please contact the customer and remind them to use the remaining balance before it expires.
- Recipient: Your customer service team's email address
- Outcome: Your customer service team receives a reminder for each gift card that expires this month and still has a balance, so they can contact customers in time and reduce after-sales issues caused by expired gift cards.
Notes:
|
Usage Limits & Notes
- Query limit: Each query returns no more than the number of gift cards set in the limit condition (1–250 gift cards; 50 by default if not set). If many gift cards match your conditions, we recommend narrowing the time range and processing them in several batches, or using the page_info condition to retrieve the next page of results.
- Query only: This action does not modify any gift cards. To act on the query results, add other actions after it.
- Gift card code security: The query results include only the last four digits of each gift card code. In emails, use [Last four digits] to identify gift cards.
- No query results: If no gift cards match your conditions, the query results will be empty.