> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Pipeline Stage Template Expression Variables

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/4/fusion-server/reference/template-expressions/query-pipeline-variables

[mintlify link]: https://doc.lucidworks.com/docs/4/fusion-server/reference/template-expressions/query-pipeline-variables

[old doc.lw link]: https://doc.lucidworks.com/fusion-server/4.2/398

Query stages have the following variables available:

* `ctx`. [Context](https://javadoc.lucidworks.com/fusion-pipeline-javadocs/4.2/com/lucidworks/apollo/pipeline/Context.html): used to pass variables between stages
* `reqResp`. [QueryRequestAndResponse](https://javadoc.lucidworks.com/fusion-pipeline-javadocs/4.2/com/lucidworks/apollo/pipeline/query/QueryRequestAndResponse.html): deserializes pre-request parameters and makes them available

The format required is `<request.q>`.

<LwTemplate />

## Example

Check that a query has an `fq` filter on a given field for a given value:

In the UI, set property name to `ids` and Property Value to `req.hasParam("fq")`

<img src="https://mintcdn.com/lucidworks/1R8QVvJzt46cZDT6/assets/images/4.2/javascript-field.png?fit=max&auto=format&n=1R8QVvJzt46cZDT6&q=85&s=0d4b01cb50c6bc49a93214990dbcd1b8" alt="javascript values" width="896" height="274" data-path="assets/images/4.2/javascript-field.png" />
