1

I want to filter reports using REST api based on set of ids.So, I am storing all those ids in a set and passing it as a value like this :

request.setBody('{"reportMetadata": {"reportFilters": [{ "value": "'+setContactId+'","operator":"equals","column":"CONTACT_ID"}]}}');

But, it gives this error :

[{"errorCode":"BAD_REQUEST","message":"[For the filter 1: The filter value for ID (00328000005abcXXXX, 00328000005aXbcXXX, 00328000005aXbcXXX) is incorrect. Specify an ID that is 15 or 18 characters long, such as 006D000000CrRLw or 005U0000000Rg2CIAS.]"}].

Is there any other way to accomplish this?

1 Answer 1

2

From a brief reference to the Filter Reports on Demand documentation it looks to me like you will need to build JSON of this form:

"reportBooleanFilter": "1OR2OR3",
"reportFilters": [
    {
        "value": "00328000005abcXXXX",
        "operator": "equals",
        "column": "CONTACT_ID"
    },
    {
        "value": "00328000005aXbcXXX",
        "operator": "equals",
        "column": "CONTACT_ID"
    },
    {
        "value": "00328000005aXbcXXX",
        "operator": "equals",
        "column": "CONTACT_ID"
    },
],

as there dos not appear to be an "in" operator available.

2
  • Thanks for the reply. But I can't go with this way as there are large number of ids to be passed.
    – Smitha
    Oct 6, 2015 at 9:29
  • @Smitha The docs say max 20 so yeah a problem.
    – Keith C
    Oct 6, 2015 at 10:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .