How to remove ad customizer data using AdWords Script? - google-ads-api

I have just successfully completed Google AdWords customizer script tutorial and it will succesfully parse the file and create/update the data within the business data. However, I cannot find any documentation on how to remove a row using a script.
So, I was wondering if there was a way to remove a row from my customizer data feed using a script? If you follow the bulk upload instructions from the Manage ads and feeds documentation you just create a new column called 'Action' and then put 'Remove' in the row you want removed. Then when you upload the file it removes the row. However if you follow these instructions and use a script to dynamically update the feed the row will not be removed.
Or is there a way to replace all values within the data feed from a script?
I will be happy with either solution or just the documentation with the correct syntax on how to accomplish this.
Thanks in advance,
Stephen
Links:
Ad Customizer:
https://developers.google.com/adwords/scripts/docs/solutions/customizer
Manage ads and feeds in "Business data":
https://support.google.com/adwords/answer/6072708?hl=en

Deep within the bowels of the AdWords documentation lies a section that talks about AdWordsApp.AdCustomizerItem
So to answer my own question the correct syntax for deleting an item/row within a data source/feed is: AdCustomizerItem.remove()

Related

Is there a API call to replace a sheet?

I was wondering if there is a API call for Google Sheets where I can delete all cells in a given sheet and paste/replace with a new data. I have the new data in the form of its own sheet.
thanks!
Update cell values with Google Sheets API
Since you mentioned that you need an API call for this, I think your way to go is to use the batchUpdate method from the Google Sheets API as it is the closest thing to what you are looking for.
With the batchUpdate method you can send a UpdateCellsRequestin order to replace the information from the cells you are looking for. I will leave the official documentation below so that you can check what I just mentioned.
References:
Method: batchUpdate
Reading & Writing Cell Values
UpdateCellsRequest
For a large existing file, it seems most expedient to delete the file and create a new one with Apps Script.
For delete, you can use DriveApp. Look for methods such as .getFileById(). Or, if you prefer to programmatically search for a filename in a folder, look for .getFolderById() and .getFilesByName(). Once you get the file object, you can either use Drive API's .remove() as shown in this answer or use DriveApp's .File.setTrashed. But note the latter moves file to trash bin, not literally remove from drive.
For file creation, you can use Advanced Drive Service. see this answer for exact steps.
As for populating the new sheet, the OP implies that step is already understood. (No particular data format was provided.) So we are done!

Connecting Sheets to BigQuery

I want to connect a Google Sheets to a new BigQuery table that populates and updates the data automatically from Sheets to BigQuery. I'm using this tutorial from Google itself to do the setup.
My problem: the table connected with spreadsheet was created empty so I had to query it and save the result as another table to see and use the data.
I can't post images yet so I ask you please to check this imgur post, please.
I'm not expert in these things but does not seems to be the best way to do it. I found some spreadsheet add-ons but I'm trying to avoid them.
Any ideas what's the best way to do this kind of setup/connection?
I had to configure each column manually
BigQuery provides a variety of tools which make it pretty simple to connect the external table to BigQuery.
One option is to simply use the WebUi and the Auto Detect option which help you not to enter each column manually
This works perfectly for me also when inserting and adding data to the external table.
You can refer to BigQuery official manual on an external table for more help

Google sheets integration with Zapier: How to create a new spreadsheet based in a model

My workflow is the following:
When a new document is collected by my system I create a row in a Google Sheets to make a list.
I need to create a new Google Sheets when each row is created. And that Google Sheets must follow a specific template.
I tried to do that with Zapier and that works perfectly for blank sheets, however I need to use a template, I have formulas inside. The template is like this by the way.
Can someone help?
David here, from the Zapier Platform team.
I messed around with this a little bit and I don't believe it's possible using Zapier at this time. Because of the way our integration works, we need the headers available so we can place data.
I see that there's a "Create Column" action, which you might be able to use use in conjunction with a bunch of "create row(s)" actions, but I'm not positive it would work.
Sorry I don't have better news here. ​Let me know if you've got any other questions!

What is the easiest way to send a tweet when a row is updated in a Google Spreadsheet?

So, I have a digital tap list for a bar and I'm using Google Spreadsheets as a back end for the data. When a keg runs out I want for the bar staff to be able to copy and paste the oncoming beer over the row of cells corresponding to the keg that just ran out. What would be the best way to automate a tweet when this happens? So when they change the keg, and once they update the spreadsheet that a tweet is automatically sent out saying what new beer has been put on tap.
As far as connecting to twitter, which uses OAuth, from Apps Script, you'll need to:
reference the sample OAuth1 apps script library. This github repo has the info on how to reference that library, along with sample code for reference.
wire up to Twitter. That repo also has a sample showing integration with Twitter.
The other code you'll need in Apps Script should implement onEdit(e), to handle the edit event. You'll have to do some work to inspect the range to make sure the edit is one you care about.

Query data from Google Spreadsheet generated by Form

Currently we're having a request to integrate the Google Form functionality into our system. I'd done some searching on the web, and found that there's no way we can change the post processing of a Google Form unless we do some heavy customization using 3rd party tools.
Thus i have an idea that, when someone fill in the Google Form, he/she will need to fill in a 'user id' in the form. This will be collected as a field in the Google Spreadsheet generated by the form.
In my back end application, i would query the spreadsheet and look for the user id field input by the user. Then i would be able to know whether he/she completed the form or not.
I'm trying to look at the Google Docs API for the spreadsheet and found that there are list-based feed and cell-based feed but i'm not sure which one can achieve what i want to do. Anyone has experience in this can shed a light?
Thank you
Think of a list based feed as being like SQL. You can read rows, insert rows(at the bottom), delete rows and update rows. - you can only store data, not formulas. In contrast, A CELL based feed lets you read and write to cells, any cell, using the cell reference (R1C1 style). CELL FEED give you more control, and includes batch updates.
some sample CELL FEED code is here:
http://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/spreadsheet/cell/CellDemo.java?r=51
Another option is too use google apps script, this is maybe less work if you just want to extract data. The html service is probably the tool for the job https://developers.google.com/apps-script/html_service - as you can dont need OAuth to do the read.

Resources