Data View Date Range Filter

Unsuccessfully attempting to filter a data view using two date pickers within Kinetic WEB. I’m thinking there’s something wrong with the created view’s REST Param and I’m hoping someone can verify it.

Here’s the panel card grid setup with the two date pickers added:

Data view:

New view created with REST param:

{
“whereClausetest”: “LaborHed_ClockInDate >= ‘??{TransView.dtFrom}’ and LaborHed_ClockInDate <= ‘??{TransView.dtTo}’”
}

Result:
When selecting the created “By Date Range” view in preview mode, all records from the BAQ are shown. For the “whereClausetest”, is the correct syntax “whereClause” or “whereClause

”?

Appreciate any help/clarification. Thanks!

@hmwillett is this something you have tried to do?

Use the BAQ Options Where List.
The Rest Params is for if you’re actually calling a service… which you are not.

You also need to specify your BAQ in the view. Right now, your view doesn’t do anything.

1 Like

image

I always forget how many question marks for dereferencing…

Guess Question Mark GIF by Coins And Connections

Honestly, same.
It was in a lab book that I lost from a couple years ago. I don’t recall what the single does, but the two allows it to send a null value.

'??{Part.PartNum}'

The ?? syntax indicates that if there is no Part.PartNum value, then replace the value with an empty string, or whatever the default empty value is for the related data type.

If the syntax for that portion of the whereClause were to be changed to ‘?{Part.PartNum}’ then Part.PartNum is required. If the value is empty, then the REST call will not be made an the grid will be emptied.

2 Likes

So a nullability check like C#'s trailing ‘?’

Thanks!!!

Thanks so much for explaining that, Hannah - this worked swimmingly. I did have to set the date pickers’ mask to the BAQ field format, otherwise the filtering did not work.

That’s… Interesting.
I’d go so far as to venture that that’s a bug. A mask should have no effect on the data.

This is great. Thank you so much for the helpful thread.

I have a question. I have a BAQ with Invc_Head and Invc_Dtl so i can see who purchased Parts. There are no query parameters in the BAQ. I uplifted the dashboard from 10.1.400 and made the changes from this and the How To: Kinetic Dashboard Uplift thread. When I open the dashboard, I have to wait for every record to load before I can search. How do I keep the records from loading when the dashboard is opened? I want it to wait until I fill in the search fields on the dashboard.

Set the property “Expand at Runtime” to false for the panel card under Advanced.