Hi Aditya, There are a few required fields (e.g. IDs, Type fields for polymorphic types, etc.) that are returned by default, but my advise is not to depend on this behavior in your code. Request the fields you require explicitly in a selector, so that your code is proofed against changes in AdWords.
Cheers, Anash P. Oommen, AdWords API Advisor. On Tuesday, April 7, 2015 at 7:33:10 PM UTC-4, Aditya wrote: > > For instance, I'm just playing around with the example GetCampaigns.java > code to try to understand it better. > > Selector selector = builder.fields("Id", "Name").orderAscBy("Name" > ).offset(offset).limit(PAGE_SIZE).build(); > > That segment is straight from the example code. To my understanding, the > fields method basically selects the "Id" and "Name" fields to be returned. > This is the basic/correct result (where both Id and Name are selected) - > "Campaign with name "Campaign #1" and id "276202509" was found." > > If I get rid of the "id" part and make it > builder.fields("Name").orderAsc... , I see this result (the same, correct > result, even though the fields() call was different: > > Campaign with name "Campaign #1" and id "276202509" was found. > > But if I use builder.fields("Id").orderAsc.... > > Campaign with name "null" and id "276202509" was found. > > Does anyone know what might be going on here? If I build the selector > based on just "name", it is still able to retrieve both name and Id. But if > I retrieve based on just "id", then it seems it only finds the Id when > asked (I feel like this should be expected behavior). Is "id" special > somehow that we can access it even if we don't include it in our fields() > call? > > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/6e4b115b-46ae-46ec-9628-c95597fff5f3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.