Skip Navigation
Expand
Defining a result filter for "No Value" for REST API reports
Answer ID 9882   |   Last Review Date 06/30/2020

How do I use "No Value" as a filter value when executing a report in REST API?

Environment:

Oracle B2C Service REST API, All supported versions

Issue:

I am unable to run a report using a "No Value" filter value using the REST API.

Resolution:

To set the report value for a filter to "No Value" the REST API should have the value "~null~" in its JSON request body. Please see the example below:


{
     "id": 100001,
     "filters": [
          {
               "name": "FirstFilter",
               "values": "1"
          },
          {
               "name": "SecondFilter",
               "values": "~null~"
          }
     ]
}

Note: in the example above, a "~null~" filter is passed for a single value, as in the "equals" filter operator.

When using a list operator on the filter, such as "In List", the desired list of values is passed to the filter value as a JSON array. For example, such a filter might be:

"values": ["apples", "oranges"]

In a NamedIDOptList, adding "~null~" within an array with other members will be ignored. ["apples", "oranges", "~null~"] is equivalent to ["apples", "oranges"].

For more information visit the REST API documentation.