With the Google Sheets extension, you can enter data to a Google sheet through mBlock 5 or obtain data from Google sheets.

:::info Note:
This extension can be used only in regions where Google services are available. :::

Sign in to Google Sheets

Visit Google Sheets https://docs.google.com/spreadsheets and sign in with a Google account.
Google Sheets - 图1

Create a sheet

  1. Click + to create a sheet.

Google Sheets - 图2

  1. Name the sheet My Favorite Fruits.
    google-sheets-2.png
    3. Click Share to set the sharing.

Google Sheets - 图4

  1. Set Anyone with the link can edit, and click Copy link. Then click Done to save the settings.

5.png

Add the Google Sheets extension

  1. Click the Sprites tab and click + extension at the bottom of the blocks area.
    image.png
    2. On the Extension center page that appears, click + Add at the bottom of Google Sheets.
    image.png
    After being added, the extension and its block are displayed in the blocks area.
    image.png

    Use the Google Sheets blocks

  2. Drag the Events block when (space) key pressed and Google Sheets block connect to shared sheet ( ) to the scripts area, and paste the link of the created sheet.

Google Sheets - 图9

  1. Drag the two Google Sheets blocks input () to column () row ( ) to the scripts area. Enter Apple in row 1 of column 1, and Mango in row 2.

Google Sheets - 图10

  1. Press the space key to execute the script and see whether the data is entered into the sheet.

Google Sheets - 图11