Google Onenote



Google Apps Script gives you the ability to create custom functionality within your Google documents, including Google Sheets, Google Docs, and more. With CData Connect Cloud, you get a MySQL interface for any of the 200+ sources supported by CData, including OneNote. The MySQL protocol is natively supported through the JDBC service in Google Apps Script, so by utilizing Connect Cloud, you gain access to live OneNote data within your Google documents.

This article shows how to create a virtual database for OneNote in Connect Cloud and provides sample scripting for processing OneNote data in a Google Spreadsheet.

Our script only reads data from a specified table, but you can easily extend the script to incorporate update functionality.

Onenote

Create a Virtual MySQL Database for OneNote Data

Class

CData Connect Cloud uses a straightforward, point-and-click interface to connect to data sources and generate APIs.

  1. Login to Connect Cloud and click Databases.
  2. Select 'OneNote' from Available Data Sources.
  3. Enter the necessary authentication properties to connect to OneNote.

    OneNote uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties. See the Help documentation for more information.

  4. Click Test Database.
  5. Click Privileges -> Add and add the new user (or an existing user) with the appropriate permissions.

With the virtual database created, you are ready to connect to OneNote data from any MySQL client.

. OneNote is a digital notebook that brings 3-ring binders to the digital era. Organize notes with sections and pages to separate thoughts by theme at school, home or work. Organize your notes. Capture notes, share them with others, and access them from your computer, phone or tablet. Free with a Google account.

Google Onenote Alternative

Connect to OneNote Data with Apps Script

Google

At this point, you should have configured a virtual database for OneNote in Connect Cloud. All that is left now is to use Google Apps Script to access Connect Cloud and work with your OneNote data in Google Sheets.

In this section, you will create a script (with a menu option to call the script) to populate a spreadsheet with OneNote data. We have created a sample script and explained the different parts. You can view the raw script at the end of the article.

1. Create an Empty Script

To create a script for your Google Sheet, click Tools Script editor from the Google Sheets menu:

Onenote To Google Keep

2. Declare Class Variables

Create a handful of class variables to be available for any functions created in the script.

3. Add a Menu Option

This function adds a menu option to your Google Sheet, allowing you to use the UI to call your function.

4. Write a Helper Function

Google Onenote App

This function is used to find the first empty row in a spreadsheet.

5. Write a Function to Write OneNote Data to a Spreadsheet

The function below writes the OneNote data, using the Google Apps Script JDBC functionality to connect to Connect Cloud, SELECT data, and populate a spreadsheet. When the script is run, two input boxes will appear:

The first one asks the user to input the name of a sheet to hold the data (if the spreadsheet does not exist, the function creates it).

Google onenote download

The second asks the user to input the name of a OneNote table to read. If an invalid table is chosen, an error message appears and the function is exited.

Note, while the function is designed for use as a menu option, you can extend it for use as a spreadsheet formula.

When the function is completed, you have a spreadsheet populated with your OneNote data, and you can now leverage all of the calculating, graphing, and charting functionality of Google Sheets anywhere you have access to the Internet.

Google onenote extension

Complete Google Apps Script