Visual Builder

Get Involved. Join the Conversation.

Topic

    Vinod Kumar Kv
    How to use conditional compound filter for below criteria:...
    Topic posted November 9, 2018 by Vinod Kumar KvBronze Medal: 1,250+ Points, tagged Business Objects, Database 
    580 Views, 25 Comments
    Title:
    How to use conditional compound filter for below criteria: Service Data Provider (on table)
    Summary:
    How to use conditional compound filter for below criteria: Source: Service Data Provider (on table)
    Content:

    How to use conditional compound filter for below criteria:

    Source: Service Data Provider (on table)

    Scenario:

    By default show query all records for object with sid==$page.variables.pk

    OR

    There is filter by name text box on page: if user wants to search records based on name then use criteria
    sid==$page.variables.pk AND firstName LIKE $page.variables.nameFilter

    Basically we want to have primary key filter always. If there is value in filter text box then apply AND operator with PRIMARY KEY value

    CRITERIA: (sid==$page.variables.pk) OR (sid==$page.variables.pk AND firstName LIKE $page.variables.nameFilter)
    At any point of time only one should work.

    As of now we have below mentioned filter criteria but this code is listing all records always with .
    {
     "criteria": [
      {
       "attribute": "{{ \"sId\" }}",
       "op": "{{ \"$eq\" }}",
       "value": "{{ $page.variables.pk }}"
      },
      {
         "op": "{{ \"$and\" }}",
         "criteria": [
          {
           "attribute": "{{ \"firstName\" }}",
           "op": "{{ \"$co\" }}",
           "value": "{{  \"$page.variables.nameFilter\" }}"
          },
          {
           "attribute": "{{ \"sId\" }}",
           "op": "{{ \"$eq\" }}",
           "value": "{{ $page.variables.pk }}"
          }
         ]
      }
     ],
     "op": "{{ \"$or\" }}"
    }

     

    Comment

    • Vinod Kumar Kv

      Hello John,

      Thanks for your appreciation. we are in the process of making complete video of the product.

      Meanwhile your understanding is correct we are using $co for name and $eq for surveyType

      Thanks

       

       

    • Shay Shmeltzer

      I think that the "not fetching until there is value in both fields" seems to be a bug.

      You might want to file a Service Request with Oracle Support.