> For the complete documentation index, see [llms.txt](https://help.tacinsight.com/fast-weigh-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.tacinsight.com/fast-weigh-knowledge-base/references/api-documentation/graphql-v2-api/reporting-with-graphql/using-graphql-in-telerik-report-builder.md).

# Using GraphQL in Telerik Report Builder

{% hint style="info" %}
Some of the information about the GraphQL API may have changed since this article was written and the videos were recorded! \
\
For the most up-to-date information on the GraphQL API, check out our other GraphQL articles in this section!
{% endhint %}

## Connecting GraphQL to Telerik Report Designer

### How to Connect to GraphQL

{% embed url="<https://www.loom.com/share/64e24d87b27f4a24accfc247c10b6ed6>" %}

{% hint style="info" %}
Note: Make sure you are running Telerik Report Designer version 14.0.20.219 or later.
{% endhint %}

1. Navigate to the Data tab of the Report Designer

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e71ad239e5d05141b60769/file-M4TnxW1m5y.png" alt=""><figcaption></figcaption></figure>
2. Select "Web Service Data Source" to bring up the configuration wizard&#x20;

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e72d248200bc052eb7ff80/file-nIrgEKPVjf.png" alt=""><figcaption></figcaption></figure>
3. Enter the GraphQL Endpoint URL into the Service URL: `https://graphql.fast-weigh.com/`

   1. Set the "Method" to "Post"
   2. Enter the Body from the [Insomnia plugin](https://help.tacinsight.com/article/158-tooling) "Fast-Weigh: Copy Telerik Body"
   3. Set the Data Selector to `$.data.*`

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e71cd639e5d05141b60784/file-ZfpO5gMRfb.png" alt=""><figcaption></figcaption></figure>
4. Click Next > to configure the Request Parameters<br>

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e720fb39e5d05141b607b9/file-iDTqWHlg3C.png" alt=""><figcaption></figcaption></figure>
5. Create a new parameter called `x-api-key`.
   1. Set the Type to Header
   2. Enter the API key in both the Value and Design-Time Value fields

      <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e72c1c2130e5169467e142/file-IxYcMSWsJi.png" alt=""><figcaption></figcaption></figure>
6. If you are using a `WHERE` clause in your Body, check out the [#using-telerik-report-parameters](#using-telerik-report-parameters "mention") section for more information

![](https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f953db39e5d05141b6520d/file-N8a1qIay5B.png)

{% hint style="info" %}
Note: In our example, our "Inline Parameters" are the @FromDate and @ToDate.
{% endhint %}

7. Click "Next >" to show the "Preview Your Data" page
8. Click on the "Download" button to run the Preview

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e71fc42130e5169467e0df/file-f3IQW2gCep.png" alt=""><figcaption></figcaption></figure>

9. Click "Finish >>|" to load in your dataset to use in your report.

## Using Telerik Report Parameters

### **Required Parameters**

{% embed url="<https://www.loom.com/share/3650b726fcb9448fac97b2ade48b852e>" %}

When building your reports within Telerik, you have the ability to link your GraphQL Where Clause directly to dynamic parameters within Telerik to filter your data.&#x20;

1. Ensure that you have your Where Clause set up within your GraphQL Query.
   * When you copy your query Body over from Insomnia, it should auto-generate Telerik parameter connectors in your variables.

![](https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f94bde2130e51694682b20/file-VRj3E86icQ.png)

2. Click Next to go to the Configure Request Parameters page. Here, you will see your auto-generated parameters.

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f94cb48200bc052eb848b1/file-kktLGHEXgV.png" alt=""><figcaption></figcaption></figure>

3. Make sure the "Type" is set to "Inline" for any Parameters that are passed to your GraphQL Body.
4. Enter the values you want to use for the data *preview* in the "Design-Time Value"

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f94e502130e51694682b2e/file-yAw7JiEvfw.png" alt=""><figcaption></figcaption></figure>
5. Set up the parameterized value in Value by selecting the drop-down > "New Report Parameter" (if you have pre-set up your parameter, just select it from the list).

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e71e3b68cd260cc2d31f69/file-mKxeJ7gyPp.png" alt=""><figcaption></figcaption></figure>
6. Set up the Telerik Parameter in the Report Parameter Editor pop-up&#x20;
   * For more information about what the settings here are, check out this [Telerik Report Parameters Docs](https://docs.telerik.com/reporting/designing-reports/connecting-to-data/report-parameters/overview?_ga=2.112838340.1703901387.1643659144-1683244178.1632834527)
   * Click here for more info on [the difference between Blank and Null](https://sqlskull.com/2019/12/10/null-vs-blank/).

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e71eb068cd260cc2d31f72/file-pOzclQ1Gli.png" alt=""><figcaption></figcaption></figure>

7. Some GraphQL Where clause formats will need to add extra formatting in your Value

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f95b64d86136157d99fabc/file-RDig9jTtZu.png" alt=""><figcaption></figcaption></figure>

   * **Strings**: Make sure your body *does* have quotes around the @variable in the Body.
   * **Integers**: Make sure your body *does not* have quotes around the @variable in the Body.
   * **Dates**: Make sure your body *does* have quotes around the @variable in the Body.
     * You will also need to add the following formatting to the Value expression to ensure that the date is in the correct Year-Month-Day format:\
       `= Format("{0:yyyy-MM-dd}", Parameters.NAME.Value )`
   * **String Arrays**: Make sure your body *does not* have quotes and *does have brackets* around the @variable in the Body
     * You will also need to add the following formatting to the Value expression to ensure that each value selected is wrapped in quotes and separated by commas:\
       `='"' + Join('","', Parameters.NAME.Value ) + '"'`
   * **Integer Arrays**: Make sure your body *does not* have quotes and *does have brackets* around the @variable in the Body.

     * You will also need to add the following formatting to the Value expression to ensure that each value selected is separated by commas:  \
       `=Join(',', Parameters.NAME.Value )`

     <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f960f839e5d05141b6528a/file-NF1eXO0euX.png" alt=""><figcaption></figcaption></figure>
8. Click Next to preview your data using the "Design-Time Value", then click Finish.
9. Navigate to the Home tab on the top of the report and click Preview to test your parameters.<br>

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f96464d86136157d99fb1a/file-tI12rXZ83U.png" alt=""><figcaption></figcaption></figure>

### **Optional Parameters**

{% embed url="<https://www.loom.com/share/7337c728848143298e5fee83a619dae8>" %}

In addition to Required Parameters that directly filter what is returned from your Data Source, you can also use Telerik by itself to create optional parameters and filters.

1. Set up the parameter by right-clicking the white space on the report and then clicking "Report Parameters..."

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f99acb39e5d05141b65434/file-VCkjQuGNfQ.png" alt=""><figcaption></figcaption></figure>
2. Add in a new Parameter in the Report Parameter Editor pop-up&#x20;
   * For more information about what the settings here are, check out this [Telerik Report Parameters Docs](https://docs.telerik.com/reporting/designing-reports/connecting-to-data/report-parameters/overview?_ga=2.112838340.1703901387.1643659144-1683244178.1632834527).
   * Click here for more info on [the difference between Blank and Null](https://sqlskull.com/2019/12/10/null-vs-blank/).
3. Click OK to close the pop-up.
4. Right-click the report white space again and this time select Filters...
   * You can also use Filters for simple data filters like filtering out all voided tickets.

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f9716ad86136157d99fb8a/file-MX86U1JWSN.png" alt=""><figcaption></figcaption></figure>

5. Add a new Filter that you will map to your new Report Parameter
   * Since we want this parameter to pull in **everything when blank** **or filter to one customer** when filled out, we will need to add in more to the expression than a simple filter.
6. Under the Expression side of the filter editor, click on the drop-down arrow and select "\<Expression>"
7. Click in the text box **after the equals sign**
8. Navigate to Functions > Logical and double click `IIf` to add it into the text box above.&#x20;
   * You can also manually type this instead of pulling it in from Functions)

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f972c268cd260cc2d36a8e/file-3gnOQUs49S.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f972ee68cd260cc2d36a90/file-qnnwsW5vxd.png" alt=""><figcaption></figcaption></figure>

5. Begin the conditional IIf statement with a check to see if the parameter is blank.
   1. Here, we are using `Parameters.CustomerID.Value`
   2. Add in the parameter value by navigating to Report Parameters > click the + by the parameter name > double click Value

      <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f972a42130e51694682c61/file-Pq4uLYI67L.png" alt=""><figcaption></figcaption></figure>
   3. In the text box, click between the end of the Value and the parenthesis and add in an equal sign and an empty quote: `= ""`
   4. This completes the check to see if the parameter is blank.

      <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f9734e8200bc052eb84a09/file-2jxCDAQrc5.png" alt=""><figcaption></figcaption></figure>
6. Click in the text box after the empty quotes and add a comma to begin the truePart of the `IIf` statement.
   1. Here, we want nothing to happen if the expression is true (the parameter is blank).
   2. Add in another empty quote: `""`
   3. This completes the truePart of the `IIf` statement.<br>

      <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f974138200bc052eb84a0a/file-EhcGBywIfJ.png" alt=""><figcaption></figcaption></figure>
7. After the truePart, add another comma to begin the falsePart.
   1. Here, we want the Customer ID to populate if the expression is false (the parameter is not blank).
   2. Navigate to Fields and double-click on the field you want to populate if the parameter is not blank (what it will be matching to in the returned data).
   3. This completes the falsePart of the `IIf` statement.

      <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f995dfd86136157d99fc65/file-cqDgIBgLTE.png" alt=""><figcaption></figcaption></figure>
8. Click OK to close the Expression Editor.
9. Under the Value side of the filter editor, click on the drop-down arrow and select the Parameter.

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61f9973539e5d05141b65417/file-TQhk81p30f.png" alt=""><figcaption></figcaption></figure>

10. This completes your entire optional filter. Go ahead and close the Filter Editor.
11. Navigate to the Home tab on the top of the Report Designer and click Preview to test out the report.
    * You should be able to leave your new parameter blank (you may have to click inside of the field and then click out in the report designer so it registers and blank) or type in a value to filter the report to that single value

## Handling Nullable Tables in Telerik

Sometimes, you may have a table linked in your GraphQL query that can be set *or* completely blank depending on the parent table it is connected to.

A good example of this would be if you wanted to show the Order Salesperson Name, *which might not always be set on the Order*. When you query this in GraphQL, it can return in two ways:

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9bdf368cd260cc2d32e5f/file-sgtG4fgQIc.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9be062130e5169467efac/file-Fj43LT572k.png" alt=""><figcaption></figcaption></figure>

While the way this data is returned may be fine in the JSON view, it can cause some major problems in Telerik. This is because you end up trying to call a field object that either exists and returns correctly or doesn't exist at all:

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9bbc068cd260cc2d32e56/file-JULqNNGAUV.png" alt=""><figcaption></figcaption></figure>

```
=Fields.Order.Salesperson.Name
```

When you add the Salesperson Name field to the report like normally and then run the report, the Orders that *do not* have a salesperson will show you the following error in place of where the name would be:

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9ba938200bc052eb80dff/file-AEF9fM8EMV.png" alt=""><figcaption></figcaption></figure>

"An error has occurred while processing TextBox 'textBox2': The expression contains object 'Name' that is not defined in the current context."

***

If you do receive this error for the Salesperson Name field (or any other field), there is a workaround you can use to display the name when it is set or hide the object entirely when it is blank.

1. Navigate to the Insert tab at the top of the Report Designer.

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9badd68cd260cc2d32e4b/file-JzVfhlwrA1.png" alt=""><figcaption></figcaption></figure>
2. Inset a "List" from the Tables section.

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c150d86136157d99bf15/file-BE49tXw8wN.png" alt=""><figcaption></figcaption></figure>
3. Select the new List object, and navigate to the Properties Panel on the bottom-right.

   <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c17c8200bc052eb80e48/file-VU7rFInN5I.png" alt=""><figcaption></figcaption></figure>
4. Find the Data section of the Properties.
5. Click on the "..." button to edit the Bindings.

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c1b2d86136157d99bf1a/file-y3gh2yun4K.png" alt=""><figcaption></figcaption></figure>

7. Add a new Binding.
8. Set the Property Path to "DataSource"
9. The Expression needs to be the *parent* of the field you are wanting to display. In this case, we want to see `= Fields.Order.Salesperson.Name` so we will set the Expression to\
   `= Fields.Order.Salesperson`
10. Click OK to save the Bindings

    <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c1edd86136157d99bf1b/file-i4QzEHyh7g.png" alt=""><figcaption></figcaption></figure>
11. Click inside of the new List object, add in new text boxes for the field title and the field itself, and set up their formating

    <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c2d4d86136157d99bf26/file-QidtflxCLq.png" alt=""><figcaption></figcaption></figure>
12. In the field where you want to show the salesperson's name, you only need to add the second half of the expression we referenced for the DataSource `= Fields.Order.Salesperson.Name`.&#x20;
    1. In this case, we only need to input `= Fields.Name` to get the Salesperson Name.<br>

       <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9bd408200bc052eb80e18/file-c2iVS2Q35t.png" alt=""><figcaption></figcaption></figure>
13. Lastly, make sure to preview the report for both fields that should have a Salesperson and should be blank to make sure everything functions as expected.

    <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c4928200bc052eb80e5f/file-cy6rsoRQGs.png" alt=""><figcaption></figcaption></figure>
14. In my example, including the field title in the list ensured that it was hidden entirely when there was no salesperson set, but you can keep the title outside of the list to prevent this.

    <figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c55939e5d05141b61706/file-M44LQ7v2ra.png" alt=""><figcaption></figcaption></figure>

    1. If you do not want the field to be entirely blank, you can set a "NoDataMessage" and "NoDataStyle" in the Properties Panel&#x20;

<figure><img src="https://s3.amazonaws.com/helpscout.net/docs/assets/5dadcbbb04286364bc90ab50/images/61e9c60b2130e5169467f010/file-4N7BGpAFfT.png" alt=""><figcaption></figcaption></figure>

## Grouping Data

{% embed url="<https://www.loom.com/share/59c88264874a44af8c89b1b38acec917>" %}

## Styling Your Report

{% embed url="<https://www.loom.com/share/13d4f8eacc80474b9d48120c7ff18fea>" %}

## Conditional Formatting

{% embed url="<https://www.loom.com/share/4743aa664b2f45bd8c42ab29d432585f>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.tacinsight.com/fast-weigh-knowledge-base/references/api-documentation/graphql-v2-api/reporting-with-graphql/using-graphql-in-telerik-report-builder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
