▶️Using filters to dynamically display content
When building with Webstudio, you get dynamic, not static. This enables providing search and filters to your visitors. Whether you want to filter your blog or create a dashboard, you can use Webstudio
Overview
Unlike static website builders, Webstudio enables dynamic filtering by:
User submits search form → values go into URL query parameters
Page reloads with parameters in URL
API query uses parameters to filter results
Collection displays filtered data
Step 1: Create the Search Form
Add a Form component (not Webhook Form)
Inside, add: Label + Text Input + Submit Button
Name the input (e.g., "name") — this becomes the query parameter
Step 2: Create the Results Collection
Add a Collection component
Inside, add elements for each field (heading, text, images, etc.)
Wrap the Collection in a Box to control layout/spacing between items
Step 3: Set Up the API Resource
Select the Collection's parent element → Settings → Add Variable
Type: Resource
Get the curl command from Airtable's API Documentation (Help → API Documentation)
Paste it — Webstudio auto-parses URL and headers
Remove
max_recordsandviewparameters to get all records
Step 4: Add Dynamic Filtering
Use the Expression editor to build a dynamic URL with Airtable's filterByFormula parameter:
Basic Filter (always applied)
Conditional Filter (only when search param exists)
Key concepts:
Backticks (`) create template literals for mixing static and dynamic content
${...}inserts dynamic valuessystem.search.paramNameaccesses URL query parametersTernary operator
condition ? ifTrue : ifFalsefor conditional logicAirtable requires values in quotes:
SEARCH("value",{column})
Step 5: Bind Collection Data
Select the Collection → Data → bind to
resource.data.recordsBind each element inside:
collectionItem.fields.fieldname
Debugging
Inspect the resource variable to see the JSON response
Status 200 = success; 4xx/5xx = error
Check for "undefined" in your query — means the parameter wasn't found
Related
CMS – Understand how dynamic content works in Webstudio
Collection – Display lists of dynamic data
Variables – Create and use variables for dynamic content
Airtable Integration – Connect your Airtable base to Webstudio
Form – Build forms to capture user input
Last updated
Was this helpful?
