Join the Webstudio community

Updated 7 months ago

dynamic filtering

At a glance

A community member is having trouble with dynamic filtering and has shared an expression they've tried. The comments indicate that the expression has issues, and another community member suggests a different syntax for the ternary operator that might work better. However, there is no explicitly marked answer in the comments.

Useful resources
Hey guys i've tried to do dynamic filtering and i dont understand what wrong with my expression can you help me ? https://api.airtable.com/v0/appHqIZKwuxJG4YrH/Table%201${$ws$dataSource$A5e7Gbhkd2lrMhvrPJSeC.search.name ? ?filterbyFormula=Search("${$ws$dataSource$A5e7Gbhkd2lrMhvrPJSeC.search.name}", {name}) : ''}
O
3 comments
this has lots of issues
I am not sure what exactly the logic was supposed to be around {name} part but syntax at least for the ternary would be this:

Plain Text
`https://api.airtable.com/v0/appHqIZKwuxJG4YrH/Table%201${
  $name
    ? `filterbyFormula=Search("${$name}")`
    : ""
}`;
where $name needs to be replaced by the variable
Add a reply
Sign up and join the conversation on Discord