18.4.8.5 Filter Parameters for Query By Example and Parent and Child Use Cases

Learn about filter parameters for Query By Example (QBE) and parent and child use cases.

About Building Query By Example Use Cases

To easily build a cascading select list and Query By Example (QBE) use cases, a BOSS REST Data Source enables 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

  • The filter operator to use:
    • equals (eq)
    • case-insensitive contains (contains)
    • case-insensitive starts-with (startswith)
  • 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)

The filter parameter name has this format:

attrName_operator$behavior

Cascading List Use Case

For example, on a data source named SubcomponentsForComponent 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 BOSS 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. Then, configure P3_COMPONENT_ID as the Parent Item of the P3_SUBCOMPONENT_ID select list page item in the Page Designer and your cascading lists will work as expected.

Query by Example Page Use Case

Suppose you have a data source named People. To perform case-insensitive contains matching on the 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

On 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 property, you have a working query by example page.