Using function in dashboard to populate BAQ parameter

I have a dashboard in which I want to display a grid containing job data, I have a BAQ that accepts a list of job numbers to filter the data and I have a function which returns a delimited string of job numbers. What I want to do is click a button which triggers the function to get the job numbers and update the displayed data to only contain these job numbers. This should be relatively simple but I cannot find how to assign the returned delimited string from my function to a variable in my dashboard and then pass it as a parameter to my BAQ. I’ve also tried writing a wrapper function which takes my delimited string function, my BAQ and calls the BAQ with the string of job numbers as my input parameter but I haven’t had any luck with that (I’m also not really sure how to pass variables to a BAQ List parameter so I might be getting that wrong).

I’m relatively new to Epicor so I’m not sure if this is possible or if I’m just missing something, any guidance on how to achieve this would be greatly appreciated, thanks.

You can generally acess the response with {actionResult.jobNumbers} where jobNumbers is you’re string delimited string from the function. It is not super simple to pass a list as a parameter from application studio and I am unable to figure out how so probably some what complex.

My recommendation here would be to do all of this in one BAQ. Use a subquery to retrieve the job numbers then in the top query filter in all of the job numbers from the subquery. I would try to retrieve all of this in one function call either it be function or BAQ.

Have you thought of using a BAQ with a subquery here?
Using SubQueries – Kinetic 2025.2

In your execution params, you add an additional param of the same name for each of your list values.

Here’s an example of a wrapper function that parses the list adding params like Kevin said:

You could also make your BAQ list param optional and instead pass the delimited list via where IN(string) like so: Erp-baq send list parameter to a baq - #23 by jbooker

Another idea, which might not be scalable, but suitable for a one off, is make the baq updatable, and use advanced bpm update, pre on Getlist.

The execution parameters are available and can be manipulated on the fly.

You could split them and do it all self contained.

like so: Erp-baq send list parameter to a baq - #27 by ridgea

Nice, didn’t know there was a demo of this.

Great minds… @ridgea

Since a baq list param is likely used in a criteria where IN() under the covers, aren’t we concating then parsing so they can concat again to hand to SQL (?) :person_shrugging:

not judging, options are a good thing - just think it’s dumb the executebaq needs separate params.

Apologies if this is a basic question, but I now have another function that takes as an input my string of delimited job numbers and handles the calling of my BAQ and handles the parsing of the job numbers (thanks @klincecum @jbooker) and returns my BAQ as a dataset, which I now want to display on my application studio dashboard. But I’m unsure how to do this, do I make a view of my BAQ and then assign the response from my function (my BAQ dataset filtered to the job numbers) to that view? The part I’m unsure of is how to assign the response in the Response Parameters section.

The bigger view of what I’m trying to achieve is I have an external service with several methods that provide me with lists of job numbers based on different conditions, and I want to display these jobs from the different methods in different grids on my dashboard in application studio.

@pragat.wagle this was the bit I was missing thanks, I can now at least see the result from my function

In your Function action response settings. try:

Parse from Response Path: returnObj

Parameter Name: results

DataView: YourBAQDVName

or

Parse from Response Path: returnObj/results

Parameter Name: yourFunctionOutputVarName

DataView: YourBAQDVName

i forget.

I’ve managed to fix this now, this page was a big help for getting the data to display and would recommend anyone else with the same issue to follow this Load a dataview from a function call - #19 by hmwillett , would also highly recommend debugging with the browser developer tools. What I ended up doing was making a wrapper function which called my job numbers function and passed them to the BAQ with the method described by @klincecum and @jbooker, thanks for your help :slight_smile:

Cheers @klincecum