AI Liquid for Step 2: Matching Column
Use AI prompts in Stock Sync to automatically generate and customize Liquid mapping formulas for product titles, descriptions, pricing, inventory quantities, and product statuses.
How to Set Up Liquid Mapping with AI Prompts
Clear UI navigation path: Go to App → Feed Settings → Step 2: Matching Column
- Locate Mapped Field: Find the field you want to customize (e.g., Title, Description, Price, Quantity) and click the gear icon to open Smart Settings.
- Open AI Prompt Input: Locate the AI prompt field within the Liquid mapping settings section.
- Enter AI Prompt: Type your transformation instruction in plain language (e.g.,
Combine source data column "brand" and column "title" with a dash). - Generate & Apply: Generate the Liquid code and click Save to apply the formula to your feed setup.
Liquid AI Prompts Detailed Breakdown
1. Title & Description Field
Customise product titles and HTML descriptions using string transformations, conditions, and default values.
Prompt Example | Generated Liquid Code Output |
|---|---|
Combine source data column "brand" and column "title" with a dash |
|
Uppercase the 1st character of the source data column "title" |
|
Replace the word "failure" to "success" in source data column "title" |
|
Remove all html tag in source data column "title" |
|
Find word start with "fa", then replace it with "success" in source data column "title" |
|
Remove html tag in source data column "title" |
|
Use source data column "title", if empty default to "No title" |
|
Use column "title", if blank, then use column "title2" |
|
If column "type" is 1, use column "title", else use column "sub_title" |
|
Change current product description to lowercase |
|
Change current product description to uppercase |
|
2. Quantity Field
Calculate stock quantities based on logic rules, string prefixes, range comparisons, or multi-column arithmetic.
Prompt Example | Generated Liquid Code Output |
|---|---|
If column "a" value is "HIGH", return 10, else return column "qty" |
|
If column "qty" value is less than 5, return 0, else return column "qty" |
|
If column "qty" value is less than 300, return column "qty" minus column "b", else return column "qty" |
|
If column "qty" value is less than 0, return column "qty" multiplied by column "a" (as a positive number), else return column "qty" |
|
If column "qty" value is less than or equal to 30, return 5, else return column "qty" |
|
If column "qty" value is greater than 10, return 15, else return column "qty" |
|
If column "qty" value is greater than or equal to 20, return 50, else return column "qty" |
|
If column index 5 is equal or more than 10, return column index 5 by multiply 0.5, else return 0 |
|
If column "qty" value starts with "Incoming", return 0, else return column "qty" |
|
If column "qty" value ends with "delivered", return 0, else return column "qty" |
|
If column "qty" value is between 20 and 50, return 20, else return column "qty" |
|
If column "a" value equals "disponible" and column "qty" is less than or equal to 0, return 1, else return column "qty" |
|
For all products, return 15 regardless of column "qty" value |
|
For all products, return column qty divided by column a |
|
3. Price, Compare at Price, & Cost Field
Apply multiplication multipliers, percentage discounts, vendor-based price conditions, or maximum price caps.
Prompt Example | Generated Liquid Code Output |
|---|---|
Current variant price multiplied by 1.7 |
|
Multiply column "price" by 1.5 |
|
Add 80 to column "price", then multiply by 1.5 |
|
Decrease current price by column "discount", calculation is divide by 100, then multiply by column "discount" |
|
If the current product vendor is "abc", multiply column "price" by 1.5, keep it the same |
|
If the current product vendor is "abc", multiply column "price" by 1.5, if the current product vendor is "def", multiply by 1.8, else remain the same |
|
Multiply column "DBP" by 1.10 and 1.15, if the result is higher than column "RRP", return column "RRP", else return the result |
|
Multiply the current variant compare at price by 0.5 |
|
Multiply current variant cost by 0.5 |
|
4. Status Field
Automatically control product statuses (active, draft, archived, unlisted) based on inventory levels, prices, or vendor tags.
Prompt Example | Generated Liquid Code Output |
|---|---|
If source quantity is 0, return archive; otherwise active |
|
Set draft when price is under 5, else active |
|
If the discontinued column says "yes", return archive; otherwise active |
|
Products with no image1 should be draft, the rest active |
|
If title contains "sample", return unlisted, else active |
|
Map availability column: "in stock"→active, "discontinued"→archived, else draft |
|
If the "compare at price" column is filled (on sale) return active, else draft |
|
Keep the current product archived if it already is; otherwise active when stock exists, else draft |
|
If there's no brand value, return unlisted; otherwise active |
|
Quantity tiers: 0→archived, under 5→draft, otherwise active |
|
Key Rules & Technical Details
- Object References: Use
data["column_name"]ordata.column_nameto reference raw feed data,product.propertyfor existing store product fields, andvariant.propertyfor variant properties. - Data Type Casting: When performing numerical comparisons on string columns, cast the string to a number first using
| plus: 0or| plus: 0.0. - Status Capitalization Requirements: Output status strings in lowercase (
active,draft,archived,unlisted) to prevent Shopify catalog status errors.
Troubleshooting Steps
- Issue: The AI-generated code produces a syntax error → Solution: Check that column headers in your AI prompt match the exact column names in your feed file, including capitalization.
- Issue: Numerical liquid filters (like
timesorminus) return zero → Solution: Ensure the source feed column is cast to a number before running math filters ({% assign val = data["col_name"] | plus: 0 %}).
Good Articles to Continue
- Matching Column Setup → Step-by-step guide on mapping fields in Step 2 of Stock Sync.
- How to Set Up Custom Text Formatting → Detailed instructions on custom text formatting.
Updated on: 15/10/2026
Thank you!
