--- title: "Return Images in Query Results" slug: "return-images-in-query-results" description: "Display headshots in Slate query Preview Results with a Materials join, a Concatenate export, and a nested stream formula." updated: 2026-10-14T20:09:03Z published: 2026-10-14T20:09:03Z canonical: "knowledge.technolutions.net/return-images-in-query-results" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Return Images in Query Results You can display an image from a record's Materials tab in query results using a formula subquery export. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/include-images-in-your-query-results----a-slate-bytes-example-aXDL6wxyvw97l7L) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## Before you begin To see this in action, you must have a test record handy with an image in its materials. Upload an image to the **Materials** tab of a person record. Select your image material type. Use that same material type in the filters below. 📖 [Uploading Materials](https://knowledge.technolutions.net/docs/en/uploading-materials) ## Import our example query Copy this [Suitcase](/docs/suitcase-import) ID and paste it in **Database → Suitcase Import** to import a pre-made example query: ```SuitcaseID 5013e1e1-1a5e-4101-bd6c-ebc7a75a1414:slate-advancement-showcase ``` This example query, from our Advancement Showcase, uses person record headshots as the image. Besides this being used in export names, it is used in the `Headshot Exists` subquery filter—so unless you also happen to have a *Headshots* material type, you’ll need to swap this filter value out for a type that refers to images. ## Selecting only records with images 1. Open a query with the base **Configurable Joins - Person**, then select **Edit Query**. 2. Add person exports, such as **Person First** and **Person Last**, to identify each record. 3. Add a **Subquery Filter** and name it *Image Exists*. Set **Aggregate** to **Exists**. 4. In the subquery filter, add a join to **Materials**. 5. Add the **Materials / Name** filter and select your image material type. 6. **Save** the filter and the subquery filter. ## Creating the image HTML export A Concatenate subquery export combines the start of an image tag, the material's stream value, and the end of the image tag. 1. Add a **Subquery Export** and name it *Image*. 2. Set **Output** to **Concatenate** and **Row Limit** to `1`. Leave **Export Separator** blank. 3. Within this subquery export, add a join to **Materials**. Add the **Materials / Name** filter and select your image material type. 4. In **Exports**, add a **Literal**. Enter the following value, then save the literal: ```xml ``` 10. Keep the exports in this order: the opening literal, the `stream` subquery export, and the closing literal. 11. Set **Format Type** to **HTML.** 12. **Save** the image export. ## Adjusting image presentation You can change the subquery export’s final **Literal** value to adjust the image size and shape. ### Small circle A circular image, 50 pixels wide and 50 pixels high. ```xml &pg=0&z=100" style="border-radius:50%;width:50px;height:50px;object-fit:cover;"/> ``` ### Small square A square image, 50 pixels wide and 50 pixels high. ```xml &pg=0&z=100" style="width:50px;height:50px;object-fit:cover;"/> ``` Both options use `object-fit: cover` to fill the specified area without stretching the image. Parts of the image can be cropped. For a larger image, change both `50px` values to `100px`. ## Viewing images in the query results View the images returned by the query in **Preview Results** or by selecting **Run Query**.