Pass Current User to External BAQ

Hi there.

I’m in a similar situation and your post is heading down the path I want here.

I’m using an external BAQ and want to pass the current user DcdUserID into the extBAQ.

I’m in the Define Parameters screen but can’t figure out how to set the default value to the DcdUserID.

Any tips? I can’t have the BAQ return all the results and need to filter out by DcdUserID in the query for performance.

Thanks in advance.
Greg

Do you have the user id as a column in your view? If so, you can just add a table criteria in the External BAQ query builder for Field: DcdUserID = BAQ special constant (CurrentUserID)
Here’s an example where I’ve done this:

This should filter the query prior to instantiation.

1 Like

You can disply the current user id in the ext baq by using a calculated field and special baq constant

-Jose

1 Like

My research shows that external BAQ can only use tables or views, so this will not work.

I need the CurrentUserID prior to running the query for performance as there are a lot of rows. Also, by not having that ahead of time, I would need to return 10-15x the rows to list all the users possible for each data row and then could filter that out but that’s even more inefficient.

I’ve stuck with modifying the internal BAQ for now.

Thanks

You can add the current user to the External BAQ Like this

Add Calculated Field

Add Constant

Display Current User in BAQ

Or you can Filter by Current User
image

image

2 Likes

We’ve gotten around this by defining input parameters to a table valued function and pass the userid to the function. Hope this helps
Tanner

Thanks guys…

Jose, filtering in the BAQ based on CurrentUserID will not work as the filtering needs to be done in the external query or else the performance is unacceptable.

Tanner, I’ll def check out the table valued function approach… looks promising.

G

FYI… I did a blend of external BAQ to handle the complex joins I needed and then did the CurrentUserID filtering in the external BAQ as well and performance was not affected.

Right. The criteria should just append the where clause to the view rather than “filtering” the returned dataset.