You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Using $regex in AttributeFilterOperator

edited Sep 4, 2018 10:08AM in Visual Builder

Summary

How to use regex in filter filterCriterion

Content

Hello Experts,

I have a webservice endpoint which has some filterCriterion defined to restrict the data. The filters look like:

"variables": {
    "getServiceDataProvider": {
      "type": "vb/ServiceDataProvider",
      "defaultValue": {
        "endpoint": "serviceRequests/getServiceRequests",
        "idAttribute": "SrId",
        "itemsPath": "items",
        "responseType": "flow:getServiceRequestsResponse",
        "filterCriterion": {
          "op": "$and",
          "criteria": [{
            "attribute": "{{ \"col1\" }}",
            "op": "{{ \"$eq\" }}",
            "value": "{{$page.variables.var1}}"
          },
          {
            "attribute": "{{ \"col2\" }}",
            "op": "{{ \"$eq\" }}",
            "value": "{{$page.variables.var2}}"
          }]
        }
    }

Now one of these filter columns needs to have some multiple static strings in the filter criteria to be searched with some "in" clause like:

 {
            "attribute": "{{ \"StatusCd\" }}",
            "op": "{{ \"in\" }}",
            "value": "{{\"SVC_PENDING_RESOURCING\", \"SVC_PENDING_DELIVERY\"}}"

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!