X

Shay Shmeltzer's Oracle Development Tools Tips

Filtering Data in Visual Builder Lists and Tables - Revisited

Shay Shmeltzer
Director of Product Management - Oracle

One of the first blog entries I did about the then new Visual Builder in May 2018 was about filtering data in a collection / table, which was followed by another entry about using compound conditions for filtering. Since then Visual Builder evolved with new releases, and filtering today is even simpler thanks to a new visual query builder. So here is a quick update for those looking at how to search and filter tables or lists whether they are based on ServiceDataProviders or ArrayDataProviders.

The underlying technology/code for filtering is still the same - you define a filterCriterion made of several criteria -each specifying attribute, operand, and value combinations; but now you can do it with a little visual builder that looks like this:

Filter Builder

As you can see it also makes it quite easy to define complex, compound conditions. Also note that you can switch to see the code version of the filter you built.

In the video below I show how to use this new builder to define search pages in your app.

I also show how you can filter ArrayDataProviders - which unlike ServiceDataProvider don't expose the filterCriteria as a top level parameter but rather put it under the requestTransformOptions parameters (starting at minute 4:30).

A couple other things shown in the video are:

How to compare to null (using {{null}} , see 2:52 )

And how to make sure that when you assign values to an ADP it doesn't append the values to existing array but rather replaces them by setting the Reset Target property of the assign variable operation (see 5:49).

And for reference - an explanation of the various operands ($co, $eq, etc) is in the JET doc here: https://www.oracle.com/webfolder/technetwork/jet/jsdocs/oj.AttributeFilter.html#op

By the way, if you are trying to filter by date fields - note that they contain the date+time signature - so you would want to bind an input DateTime component - or use another way to get your filter value to be formatted similar to this -  '2019-12-31T00:00:00'

By the way if you can't get the filter to work, check out the q parameter value created in the call to your REST service in the browser's network tab. To learn more about the q parameter and using it for filtering see this blog entry.

Also - note that the filterCriterion concept works out of the box on REST end points for Visual Builder Business Objects and those created from ADF Describe specifications (such as Oracle SaaS end points). If you are using a "random" other REST service, you can either specify parameters for searching directly in your call as shown here, or write a transform function as shown here.

 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.