Dataview Loading Filtered Subset from Response

I am using a function to call a BAQ with search criteria and then I fill a dashboard grid with the results.

The problem I’m running into is that the dataview is not taking in all the data from the response


The actionResult shows 469 lines of data.

image
The dataview is loaded with 21 lines.

As I gather this information, I noticed that all the lines are from the same Site - so I went through the full set and see that there are exactly 21 lines from that one Site :face_with_spiral_eyes:

So there’s apparently some sort of filter being applied as the data gets loaded to the dataview … but where?

I’m setup without filters here:

And no filters on the dataview:

Only other place I can think of where a filter might be applied is something in the grid, but it was setup using guided setup, and there’s basically nothing in it, except the epBinding to my dataview, and the columns are built out.

Hello, I ran into exactly this problem before, which i documented a workaround for on a thread here:

https://www.epiusers.help/t/using-a-function-to-abstract-data-to-a-dashboard-allowing-multiple-baqs-to-feed-one-dashboard-based-on-context-like-company-and-overlaying-where-criteria-on-a-baq-pre-execution/130162

Try using an intermediary dataset in your function, and then create a new datatable with appropriate columns and copy the data into the new datatable, then output only the new datatable in opDS (so you aren’t outputting anything from the dataset returned from the baq directly - only your copied stuff)

(p.s. if it works, maybe we can narrow down the cause and report it to get fixed, i didnt check the output well on my end but it might be Plant security getting incorrectly applied or something)

That is a weird solution … but if it works, it works - I’ll try it

If it is something to do with Plant security, in this case, it would be retroactively reapplied to the data, since I’ve used the BAQ schema on the destination dataview. This data is coming from an external BAQ pulling from a view we created on the ERP database.

Yup, i threw in some logging and could see that correct amount of records were coming into the datatable/dataset in the function, but when i passed it out of the function, Results table was truncated. Silent error with no indication of failure anywhere. I had a hunch that there was “something” in the data that didn’t like being passed out and caused a problem, so I limited the dataset to just what I needed output, and that worked.

I have an open bug CS0005054138 / PRB0306555 right now where if you try to input or output an int64 from a function (in a variable or within a datatable/dataset) it is rounded, this affects for example SysRevID which is an int64, you have to pass it in/out of function as a string and convert to int64 to use it. That’s at least one “silent error” i know about passing data in/out of functions and this appears to be another.

I didn’t try to diagnose anything past that but my dataset included plant column as well, with yours being limited to plant that’s what made me go hmm! I will take a closer look at my dataset when I get a chance to see if it is indeed the same “filter” being applied. It took me two months of demonstrating the issue with int64 to get a PRB, functions team is very hard to reach through support.

Well…

It wasn’t an issue with the function or its output - I’d already confirmed all the data is coming down to the client from the server. So I tried the other end first.

I removed the reference to the BAQ in the dataview definition, added each column manually (not 100% sure this was necessary), published and ran it - and everything is appearing like it should.

I’m not going to hold my breath that this was really what fixed things, but I’ll run with it for now… I do have other dashboards set up this way, that I will be checking. Will update here, if it ends up being something other than that on the other dashboards

Looking at your actionResults, the data was always coming down from server and the client-side filter isn’t likely coincidental.

The way we hear ‘no client-side ‘business logic’, it’s surely not intended plant security behavior.

Then what is it?

1 Like