In case anyone else encountered this problem. You have to edit your function and check the "has return value" box. Then your return will work. After this you have to use "Call Function" again and now you have a new field for saving results.
how to get 'ad count' and 'ad number' on google search result page
-

when i do a search on google.com, i want bot to log the number of top ads & bottom ads (eg 3 top ads, 2 bottom ads) as well as to be able to point & extract info from a particular ad (eg get title of number 2 top ad).
I could not find out the correct elements from inspection.
Plse help. thanks.