Manage blank fields with xPlore Query form in D2-Config

Hi everybody,

We have a Property page to allow users to search documents. The form contains 1 text field for fulltext search, 2 date fields, 1 dropdown field that lists document types.

In D2-Config, this property page is mapped to a Query form with xPlore query mode.

Problem:

In the Criteria section in the query form, I have: sg_doc_type = $value(sg_doc_type)

All fields in the form are optional. That means if user doesn't set a value to the "Type" field, I want that it searches for all document types.

How to manage this case in the Criteria section ? because like it's configured, the query form searches documents that does not have a type (in my case, all documents have a type, so it returns me nothing...).

The problem is similar for date fields. If user doesn't set a date value, we want to ignore the criteria. But currently, the query form searches with empty date value.

Thanks for your helps.

Environment: D2 4.5, Content Server 7.2, xPlore 1.4, xPlore query mode is required.

Comments

  • edited December 3, 2015

    Hi Hari,

    you can try using a construct like this:

    ... AND ('$value(sg_doc_type)' = '' OR sg_doc_type = '$value(sg_doc_type)') AND ...

    Regards,

    Thomas

  • edited December 7, 2015

    Hi Thomas,

    In D2-Config, in the left side we have to choose a property, we cannot put $value(sg_doc_type).

    Your workaround is good if I choose DQL query mode, but not in xPlore query mode.

    Thanks.

  • Hi,
    I have an issue similar with Xplore Query where I have a criteria applicable_sites contains $value(applicable_sites). This is supposed to fetch value as per property page.

    Problem is : The query should take multiple values from applicable_sites (any number of sites being chosen from list assistance) but it is taking only one site at a time.

Sign In or Register to comment.