SelectorError.INVALID_PREDICATE_OPERATOR

344 views
Skip to first unread message

John Albert Catama

unread,
Mar 23, 2016, 4:15:01 AM3/23/16
to AdWords API Forum
Good day,

Please help.
I'm getting error when executing this Selector: [SelectorError.INVALID_PREDICATE_OPERATOR @ serviceSelector; trigger:'Name']

SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields(CampaignField.values())
        .containsAny(CampaignField.Name, "21dayparts","28dayparts","mobile","desktop","tablet",
    "eaststates","eastmetros","weststates","westmetros",
    "cststates","cstmetros","metro","rural","allbroad","broad",
    "exact","modbroad","phrase","goog","search","content")
        .orderAscBy(CampaignField.Name)
        .offset(offset)
        .limit(PAGE_SIZE)
        .build();

Thanks in advance!

regards,
Albert

Shwetha Vastrad (AdWords API Team)

unread,
Mar 23, 2016, 2:01:37 PM3/23/16
to AdWords API Forum
Hi Albert,

I would suggest that you use the operator "in" instead of "containsAny".
Let us know if the issue is not resolved.

Regards,
Shwetha
AdWords API Team.

John Albert Catama

unread,
Mar 23, 2016, 10:37:22 PM3/23/16
to AdWords API Forum
Hi, however if i use "in" it does not return any campaigns. I expected to get a hundred of results.

Thanks,
Albert

Shwetha Vastrad (AdWords API Team)

unread,
Mar 24, 2016, 9:57:41 AM3/24/16
to AdWords API Forum
Hi Albert,

While using the "in" operator, you would need to provide complete campaign names in the search string. It doesn't support partial matching of sub-strings. 
If you are trying to get a list of campaigns, I would recommend using labels to identify related campaigns and searching for campaigns using this label. You can find more information on labels here.
An example of this is provided in GetCampaignsByLabel.java.

Let us know if the issue is not solved.
Reply all
Reply to author
Forward
0 new messages