![]() ![]() It’s a continuous process of drafting, revising and receiving feedback. Storytelling involves a lot more than chewing on the end of a pencil and creating genius one-liners that will be quoted for generations to come. Here’s an app that uses Database abstraction with google apps script via the DataHandler library.Writing a book is on many people’s bucket lists, but it's easier said than done. Read More Accessing Google Sheets directly from Excel You need to download the latest version of … Here’s a VBA app that uses Database abstraction with google apps script via the DataHandler library. Read More db access to a variety of databases from Excel There have been a number of changes to Google Docs over the years each of which has provided more ways … What can you learn here? Use Google Books APIConvert jSonTailor columns and output Getting data about a book using the … As always I look forward to your feedback, comments, and questions on our forum. You could very easily use queries other than ISBN number to create all sorts of sophisticated queries. In this case we are just scratching the surface of this excellent API. Some example valid column names are in the example in the isbn tab of the cDataSets.xlsm workbook which is downloadable hereĪs usual, Google have an ‘api for that’. There may be a list of these in the API documentation, but you can just enter this example to see the jSon response and you will see the key:value pairs that you could include as column names. ' if multiple then include the array separated by commas ' and also in the returned json get populated ' any headings that are present in the dataset Private Function rowProcess(dr As cDataRow, job As cJobject) As Longĭim hc As cCell, n As Long, jo As cJobject, jom As cJobject N = n + rowProcess(dr, job.Child("Items"))įor each row that there was an executable response to our Google query, we can check for any matching column name to query response field names, and fill them in, dealing with those multiple columns by separating the multiple values by commas. & "-" & job.Child("totalItems").Serialize) Or job.ChildExists("totalItems") Is Nothing ThenĮlseIf job.Child("totalItems").Value 1 Then MsgBox ("Google books refuses to co-operate for ISBN " _ĮlseIf job.ChildExists("Items") Is Nothing _ toString & "-" _ĮlseIf Not job.ChildExists("error") Is Nothing Then MsgBox ("Badly formed jSon returned for ISBN" &. Private Function processISBN(ds As cDataSet) As Longĭim dSet As cDataSet, cb As cBrowser, dr As cDataRowĭim jo As cJobject, job As cJobject, n As Long We already have the cBrowser class and the cJobject class from previous articles, so along with cDataSet this is pretty trivial. ' if there were any updates then commit themĮach row in the sheet is passed off to the API with a query on ISBN number, and will return a jSon format string of everything Google knows about that book. HeadingRow.Validate(True, cISBNColumnHeading) Then populateData wholeSheet("isbn"),, "isbn",, ,, True ' create a dataset from the isbn worksheet Next we check that we have an ISBN column, process the table against the Google Books API, and finally commit the updates. For getting started with these see How to use cDataSet. The first step, as with most of the examples on this site, is to get the input/output table abstracted from its physical position using Data Manipulation Classes. This has been implemented in the Module ‘isbnExample’ in the cDataSet.xlsm sheet and can be downloaded as a fully working example. Any columns whose heading does not matching the fields returned by Google books will be ignored and their contents left intact. In the case where there are potentially multiple values (for example authors), each value will be separated by commas. Any other columns which match the field names returned by Google will be populated. Our implementation will expect a column named isbn which it will use as the request to google books. A completed table might look something like this. Let’s say that we have a table of ISBN numbers and want to fill in various columns with other attributes about the book referred to by that number. In this example we are going to use a small section of it to solve a specific problem that librarians often have – How to get data about a list of books into an Excel sheet given its ISBN number. Google provides a rich and underused API to get data about books. ![]() Although this method works, you can also access the Books API and many more through the Rest to Excel library Google Books API Using this data we will complete columns as defined in your sheet, and will use Data Manipulation Classes and Excel JSON conversion. In this section we will look at how the Google Books API responds to a request for book details given an ISBN number. Getting data about a book using the ISBN number. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |