Skip to main content
Nintex Community Menu Bar

Read Google sheet data with Kryon Studio


MillaZ
Nintex Employee
Forum|alt.badge.img+21
  • Nintex Employee
  • 652 replies
Product: Kryon RPA
Product Version: 19.1 & Above
Components: Kryon Robot; Kryon Studio
Article Contributors: Zakir
In this article you will get step by step procedure on how to collect data from google spread sheets using Kryon Studio

Prerequisites: 
PreReq 1: Set up Google vision API (Will be covered in below step by step guide) https://cloud.google.com/vision/docs/setup
PreReq 2: Configure your python environment (Will be covered in below step by step guide) https://community.kryonsystems.com/KryoNet/s/feed/0D51o00006ppDQNCA2

Steps:
Setting Google vision API for Google Drive and sheets 
Configure Kryon Studio/Robot python environment
Run python script in studio to get the data 
 
Info: For google vision API, you must have gmail account. Signup with same account for Google vision API on below link and access the console: https://console.cloud.google.com/home/dashboard

 

Setting Google vision API for Google Drive and sheets

1. Go to "Google cloud console" and search for the user
 

23994iD4B7503915CFBE2B.jpg

2. Create a new project as shown below

23995iAE0ED2F37DA05B66.jpg

3.  Click on go to API Overview
23996i23B23861D1EBAB4A.jpg
 

4. Go to API Library to enable two API as guided in step 6 and 7

23997iD954D2B7C9589CB7.jpg
 

5. Search for Google Drive API

23998i06A5AF58779246F9.jpg

6. Enable Google Drive API

23999iC241DE5B537AB35C.jpg


7. Search for Google sheets API and Enable it as well 

24000i19D5D299AAF0FF7A.jpg

 

8. Create credential for access Google sheet API

24001i97E70297489E7805.jpg

9. Choose authorization and save the credential in json format

 

24002iA5E4C82B3A5028AB.jpg

 

10. Downloaded json file

24003i7FA0EB1543CA325E.jpg

 

11. Json file contains client email , copy all the contents within quotes

24004iEE03F171E0556B27.jpg

 

12. Open a google sheet on a browser e.g. in my case i created "BankData"

24005iBA6055214C5DCAE5.jpg

 

13. Share the google sheet with client email obtained in step 11, as shown in below screen.

 

24006i325AE859C05598BE.jpg

 

 

Note: There is no fixed way to create Project, enable API and get credential file in json format. You can search on google and check youtube videos guide for the same. Above steps just to contain all help at one place.

 

 

 

Configure Kryon Studio/Robot python environment

1. Open CMD window and navigate to python folder located inside Kryon Studio or Kryon Robot installed location i.e. C:Program File Kryon Studio Python

 

24007i94C8E55BD3E87565.jpg

 

2. And type >> pip install gspread oauth2clienT. And then hit Enter as shown below:

 

24008i5CCDE09BBD68B73F.jpg

 

3. Above steps will install required packages for working with google spread sheet using python

4. Use Run Script AC from Kryon Studio as guided in below steps 
 

Run python script in studio to get the data
1. Open Kryon Studio and create a new Wizard and name it as required.
2. Add Run Script AC and add below python code

 

 

 

import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ["https://www.googleapis.com/auth/drive"] creds = ServiceAccountCredentials.from_json_keyfile_name("C:\temp\MyGoogleSheetProject.json", scope) client = gspread.authorize(creds) sheet = client.open("BankData").sheet1 data = sheet.get_all_records() print(data)

 

 

 

3. Your AC should look like as below :

 

24009i216B911D81CF3CE3.jpg



3. And below is the result from variable Var_MyDT

 

24010i600E8A50F838190E.jpg


4. You can match with google sheet screen shot which is shared above.

5. Once data inside Kryon studio, now you can manipulate it as required with many other AC inside Kryon Studio.
 

More Information: https://developers.google.com/sheets/api/guides/authorizing

Translate
Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings