Happy Business Starts Here

Re: How to query subscriptions where Id in set of unique Ids

Highlighted

How to query subscriptions where Id in set of unique Ids

I would like to query subscriptions if the Id is included in this set without making multiple conditions (Id = '8adcc59c713ab0f801714e88d8a126d5' or Id = '8adc9a41713aa2d401714e8544046471' or ...):

 

[

"8adcc59c713ab0f801714e88d8a126d5",
"8adc9a41713aa2d401714e8544046471",
"8adc9a41713aa2d401714e8547b1649a",
"8adcc59c713ab0f801714e88dad826fe",
"8adcc59c713ab0f801714e88715d267b",
"8adcc59c713ab0f801714e88738026a4"

]

2 REPLIES 2
Highlighted
Zuora Staff

Re: How to query subscriptions where Id in set of unique Ids

Hey there! 

try something like

SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...)

...

and replace column_name with id and value1, value2, ... with (8adcc59c713ab0f801714e88d8a126d5, 8adc9a41713aa2d401714e8544046471, ...)

Highlighted

Re: How to query subscriptions where Id in set of unique Ids

Thank you for your reply, I know this works in Zuora Data Query, but not in the query API where I need it to work (/v1/action/query)

 

Request body:

{"queryString": "select Name from Account where Id IN ('8adcc59c7176caaf0171780bfb5d17f4','8adcba9c715ce13001716389dca157fe')"}
 
Response:
{
    "detail": {
        "MalformedQueryFault": {
            "FaultMessage": "You have an error in your ZOQL syntax",
            "FaultCode": "MALFORMED_QUERY"
        }
    },
    "faultcode": "fns:MALFORMED_QUERY",
    "faultstring": "You have an error in your ZOQL syntax"
}