18.4.7.5 Filter Parameters for Query By Example and Parent and Child Use Cases
Create filter parameters for Query By Example and parent and child use cases.
To easily build cascading select list and Query By Example (QBE) use cases, an APEX REST Data Source lets you define filter parameters on the GET operation related to the Fetch rows database action. These are URL Pattern parameters with a specially formulated parameter name that declaratively configures three aspects of runtime behavior:
-
The case-sensitive name of the attribute to filter. For example:
SomeAttr
-
Supported filter operators to use:
- equals (
eq
) - case insensitive contains (
contains
) - case-insensitive starts-with (
startswith
)
- equals (
-
The desired behavior when the parameter's value is null:
- Ignore the filter if the parameter value is null (
ignoreifnull
) - Return no rows if the parameter value is null (
norowsifnull
) - Match a null value (
matchifnull
)
- Ignore the filter if the parameter value is null (
The filter parameter name has the following format:
attrName_operator$behavior
Cascading List Use Case
For example, on a data source named SubcomponentsForComponent
suppose you want to filter on the parent attribute named
componentId
using the equals operator and return no rows if its
value is null, the filter parameter name to define is:
componentId_eq$norowsifnull
When building a page with cascading select lists for
P3_COMPONENT_ID
and P3_SUBCOMPONENT_ID
, the
latter can be a select list page item based on a shared component LOV that uses the
SubcomponentsForComponent
REST Data Source. This LOV can assign
the value of the data source's componentId_eq$norowsifnull
parameter to the value of page item P3_COMPONENT_ID
. Finally,
configure P3_COMPONENT_ID
as the parent item of the
P3_SUBCOMPONENT_ID
select list page item in Page Designer and
your cascading lists will work as expected.
Query by Example Page Use Case
On a data source named People
to perform case insensitive contains
matching on firstName
and lastName
attributes,
ignoring the respective filter if its value is null, the two filter parameter names
to define are:
firstName_contains$ignoreifnull
lastName_contains$ignoreifnull
Back in the query by example page, you can define page items
P4_FIRST_NAME
and P4_LAST_NAME
and configure
the two REST Data Source parameters above to get their value from the respective
page items. After making sure the P4_FIRST_NAME
and
P4_LAST_NAME
are mentioned in the search results region's
Page Items to Submit attribute, you have a working query
by example page.