AQWL to GAQL: Confused about changes in withCondition clauses

355 views
Skip to first unread message

aya abeliovich

unread,
Feb 8, 2022, 1:25:12 AM2/8/22
to Google Ads Scripts Forum
Hey there,

I'm trying to update the scripts in our account with the new GAQL syntax.
I've never really explicitly used AWQL, I only use it when calling withCondition so I'm a little clueless.

I have several calls to 
.withCondition(campaign.name IN ["List", "Of", "Possible", "Campaigns"]);

When I try to preview my script I get this exception message:

Exception: Call to GoogleAdsService.Search failed: Error in WHERE clause: invalid value [

This type of call used to work in the old syntax. Does it not work anymore? If so, what should I replace it with to expect the same result?

Thanks,
Aya.

Sigurd Fabrin

unread,
Feb 8, 2022, 3:04:35 AM2/8/22
to Google Ads Scripts Forum
Try this tool to build GAQL queries https://developers.google.com/google-ads/api/fields/v9/ad_group_query_builder

For the IN operator, use regular parentheses instead of brackets


Cheers
 Sigurd

Google Ads Scripts Forum Advisor

unread,
Feb 9, 2022, 1:41:15 AM2/9/22
to adwords...@googlegroups.com

Hello Aya,

 

Thank you for reaching out to us. I’m James from the Google Scripts support team. Allow me to assist you.

 

I agree with Sigurd. With the use of the IN operator, you must use parentheses instead of using brackets. For much easier construction of query, you may try this Google Ads query builder tool.

 

Let me know if you have any questions.

 

Regards,

Google Logo
James Howell Abarsoza
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2W5G9d:ref
Reply all
Reply to author
Forward
0 new messages