Hi Ajit, I think its a Ruby thing rather than an API thing. You're 1. making base_kwd an empty array, then you're 2. reassigning it to a new instance of Keyword. Then you 3. assign a new array containing only the last base_kwd (of type Keyword) to related_search.keywords.
I think you need an array and the Keyword var. I'm no Ruby expert but try something like this: keyword_list = [] related_search = @ti_srv.module::RelatedToKeywordSearchParameter.new options[:keywords].each do |k| base_kwd = @ti_srv.module::Keyword.new base_kwd.text = k base_kwd.matchType = 'BROAD' keyword_list << base_kwd end related_search.keywords = keyword_list best of luck, Julian On Tue, Feb 23, 2010 at 7:47 PM, Ajit <ajitscor...@gmail.com> wrote: > Hi Eric > > related_search = > @ti_srv.module::RelatedToKeywordSearchParameter.new > > base_kwd = [] > options[:keywords].each do |k| > base_kwd = @ti_srv.module::Keyword.new > base_kwd.text = k > base_kwd.matchType = 'BROAD' > end > > > related_search.keywords = [base_kwd] > > as you suggested.. I am trying to create an arrary of keywords and > pass to relatedToKeywordSearchParameter.. but seems like its not > working > > whats wrong with above code? > > THanks > Ajit > > > > On Feb 4, 10:26 am, AdWords API Advisor <adwordsapiadvi...@google.com> > wrote: > > HiAjit, > > > > The Keyword.text field can only accept one value. Instead what you > > should do is create multiple Keyword objects and pass them into the > > field RelatedToKeywordSearchParameter.keywords as an array. > > > > Best, > > - Eric Koleda, AdWords API Team > > > > On Feb 3, 12:59 pm,Ajit<ajitscor...@gmail.com> wrote: > > > > > Hello All > > > > > related_search = > > > ti_srv.module::RelatedToKeywordSearchParameter.new > > > base_kwd = ti_srv.module::Keyword.new > > > base_kwd.text = ['google', 'yahoo'] > > > base_kwd.matchType = 'EXACT' > > > related_search.keywords = [base_kwd] > > > > > is it possible to pass an array of keywords in base_kwd.text? > > > > > thanks in advance > > > > >Ajit > > -- > 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-...@googlegroups.com. > To unsubscribe from this group, send email to > adwords-api+unsubscr...@googlegroups.com<adwords-api%2bunsubscr...@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 post to this group, send email to adwords-...@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.