# Query Data

Let’s learn how to inject query results into your running Lightning Web Component code.

:::note
This doesn't apply to custom Lightning web components in Lightning dashboards as they don't query data.
:::

To start, modify your Hello World component to use a step by setting `hasStep` to `true` in the `js-meta.xml`.

```xml
<hasStep>true</hasStep>
```

Add the results wiring into your `.js` file.

```javascript
import { LightningElement, api } from "lwc";

export default class HelloWorld extends LightningElement {
  @api title;

  @api results;

  get stringResults() {
    return JSON.stringify(this.results);
  }
}
```

To view the query results as text, update your `.html` file.

```html
<template>
  Hello World: {title} Results: {stringResults}
</template>
```

Deploy the changes to your component to your org. Refresh your dashboard to pick up any updates to the component code. After refreshing the dashboard, edit the dashboard and click your component. You’re now prompted to select a data source. You can select a dataset to create a query or select an existing query. Make your selection and watch the query results appear in your dashboard.

**See Also**

- [Component Attributes](/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-attributes.md)
- [CRM Analytics Configuration](/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-config.md)
- [Lightning Dashboards Configuration](/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-lightning-dashboard-config.md)
- [Other Widgets](/docs/analytics/bi-dev-guide-lwc-in-db/guide/bi-lwc-in-db-hw-example-other.md)
