Skip to content
Log in

Query - Liquid tag reference

On this page

Syntax

liquid {%- query <object_name> as <variable_name> [, <field>: <value>, ...] [order by '<field> [asc|desc], ...'] -%}

Property Value
Tag name query
Type Simple tag
Source StoreConnect

Description

The query tag fetches records from a Salesforce object that StoreConnect syncs to the experience-site database, and assigns the result to a Liquid variable. Conditions are joined with AND, comparison operators (>, >=, <, <=), LIKE patterns (%), IN arrays, and data.<field> custom-data filters are supported, along with an optional quoted order by clause.

Quick example

```liquid {%- query ‘Product2’ as records, s_c__slug__c: ‘hiking-boots’ -%}

{%- for record in records -%} {{ record.name }} {%- endfor -%} ```

For the full operator matrix, ordering, distance calculations, custom data filtering, error messages, limitations, and use-case guidance, see Liquid query (full reference) and Display dynamic content using Liquid queries.

Was this article helpful?

Was this article helpful?