# Simple converted dashboard - BAQ params?

**URL:** <https://www.epiusers.help/t/simple-converted-dashboard-baq-params/83989>\
**Category:** Kinetic ERP\
**Tags:** dashboard, baq, kinetic\
**Created:** [October 27, 2021, 6:11pm UTC](https://www.epiusers.help/t/simple-converted-dashboard-baq-params/83989 "2021-10-27T18:11:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fvodden](https://www.epiusers.help/letter_avatar_proxy/v4/letter/f/7cd45c/32.png) [@fvodden](https://www.epiusers.help/u/fvodden)\
**Post date:** [November 11, 2021, 4:37pm UTC](https://www.epiusers.help/t/simple-converted-dashboard-baq-params/83989/2 "2021-11-11T16:37:05Z")

</div>

So, I think I mentioned this in another thread, but I sidestepped this issue by hiding the original grid, adding my own, then loading it with data via the `rest-erp` action and the `Erp.BO.DynamicQuerySvc.executeById` method.

1. Add a `rest-erp` action to an event. Hook the event to whatever you want.
2. In the action’s properties, specify the service name as `Ico.BO.DynamicQuerySvc`, the service operation as `ExecuteByID`.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/2/c/2c370f7f6bfb03d4e0c022745c905da3309cdba6.png)
3. Click into **Method Parameters**. For the `queryID` parameter, specify the ID of your BAQ in the `Field Value` field.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/0/6/0696a413ee3a3c3ae35d3eb0bd62d5b243fffcbd.png)  
In the `executionParams` field, specify your BAQ parameters using a JSON object…  
 ![image](https://www.epiusers.help/uploads/default/original/3X/0/6/06a88b864ee19b867f89563ac459ca047ebd5c09.png)  
similar to the following:

```auto
{
	"ExecutionParameter": [
		{
			"IsEmpty": false,
			"ParameterID": "JobNum",
			"ParameterValue": "{TransView.JobNum}",
			"ValueType": "string"
		},
		{
			"IsEmpty": false,
			"ParameterID": "AsmSeq",
			"ParameterValue": 0,
			"ValueType": "number"
		},
		{
			"ParameterID": "SortColumn",
			"ParameterValue": "Calculated_SourceBin"
		}
	]
}

```

`ParameterID` is the ID of the parameter from the BAQ parameter editor. `ParameterValue` contains the actual parameter value. You can interpolate dataview values here with the `{}` syntax. Since parameter values are sent as strings, `ValueType` can be used to specify otherwise. If the value is truly empty, `IsEmpty` can be used. This is important when triggering the **Skip Condition If Empty** BAQ parameter setting.

The `rest-erp` response from the `executeByID` method returns a JSON object of the format

```auto
{
  "returnObj": {
    "Results": [
      {
        "Part_PartNum": "BM56737",
        "Part_PartDescription": "RAM PUMP FEEDER 702 034PUMP W/RH-CONTROLS",
        "JobAsmbl_JobNum": "202443-21-1",
        "JobAsmbl_AssemblySeq": 0,
        "ParentJobAsmbl_PartNum": "BM56737",
        "ParentAsmblPart_PartDescription": "RAM PUMP FEED"
     }
  ]
}

```

1. The last step is to configure the `rest-erp` action to update a dataview with the response. This assumes you’ve created a blank dataview already. [See this post](https://www.epiusers.help/t/app-studio-dataview-without-database-binding/80966/4) by @Ishkaran for a video about this.  
 ![Configuring rest-erp](https://www.epiusers.help/uploads/default/original/3X/e/b/ebed90e996f207a2f1501342acb19211b1f6ce06.gif)  
In **Rest Services** → **ERP Rest Arguments** → **Response Parameters** add a new parameter and set `Parameter Name` to **Results** , `View Name` to the name of the view you created and `Parse from Response Path` to **returnObj**.

This should result in the data from your BAQ successfully loading into your dataview. The next step is binding your dataview to your grid and (probably?) defining columns.

1. On your grid’s properties, specify the view name in the **Grid Model** → **Ep Binding** field.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/a/3/a3fb6ad6d4fce3847a4498b4285fde367c2e0220.png)
2. Under **Grid Model** → **Columns** , add columns to the collection that you’d like displayed on the grid. Set the `Field` property to the column name from your BAQ. The `Title` property is used to set what text is displayed in the column’s header.  
 ![image](https://www.epiusers.help/uploads/default/original/3X/8/d/8da0242ead9e927645371c5eee5d63e2cfa1e282.png)

That should be it for the basic example of calling a BAQ with parameters. This method is far more flexible that the built-in BAQ binding. You can design your parameter forms however you want. You can bind different controls (textbox, combo, whatever) to a view (like TransView), then reference those values in the JSON payload.

I haven’t used this method for specifying traditional BAQ filters, but they can specified by adding **ExecutionFilter** to the JSON payload. As per the REST docs:

```auto
"ExecutionFilter": [
    {
      "DataTableID": "string",
      "FieldName": "string",
      "Neg": true,
      "CompOp": "string",
      "RValue": "string",
      "SysRowID": "00000000-0000-0000-0000-000000000000",
      "RowMod": "string"
    }
]

```

---

_[View the full topic](https://www.epiusers.help/t/simple-converted-dashboard-baq-params/83989)._
