Integrations

Google Sheets

28min
procesio x google sheets this documentation is outdated for the up to date version, visit https //docs procesio com/integrations/oauth2 google sheets https //docs procesio com/integrations/oauth2 google sheets πŸ’‘ imagine automating your work processes and workflows with procesio and having all the data and information automatically transferred and updated in your google sheets this can save you a lot of ⏰ and effort, and make your life a whole lot easier! πŸ“Š for example, let's say you're running a small business and you need to keep track of your inventory you can use procesio to create an automated workflow that updates your inventory every time a new order is placed and by integrating procesio with google sheets , you can have all that data automatically transferred and updated in a spreadsheet that you can access from anywhere, at any time πŸ“ˆ but that's not all! you can also use google sheets to visualize and analyze the data collected by procesio for example, you can create charts and graphs to track sales trends or use conditional formatting to highlight low inventory levels πŸ€– and the best part? you don't need to be a tech whiz to integrate procesio with google sheets the process is straightforward and easy to follow, and you can find lots of resources online to guide you πŸ’» what are you waiting for? put your thinking hats on and let's see the configurations we need to tackle prerequisites a procesio account and a google account postman google sheets api project & credentials creation to post in google sheets, we'll need an oauth access token , api keys only work for get requests first, we are going to create a new project in the google cloud console for api services https //console cloud google com/apis/dashboard make sure to select the newly created project from the project selector in the top left corner we now need to enable google sheets api here’s where you can enable it from once google api is enabled , click the manage button proceed with creating a credential by clicking the create credentials button in the top right corner select google sheets ap i from the select an api drop down and then hit next click add or remove scopes to select the scopes for this credential filter by api google sheets api , select the scopes from the screenshot and press update you can only filter by google sheets api , if you enabled it hit the save and continue button to go further fill in the oauth client id details as below application type ➜ web application name ➜ give a name to the credential (procesio will be ok for now) authorized redirect uris uris 1 ➜ https //procesio com/ uris 2 ➜ https //procesio app/ don't forget to click create after you fill in the details hit done and you're done with the credential part for now obtaining the oauth authentication token to generate an oauth token, we'll need 3 things client id client id part of the google sheets api credential we just created client secret client secret also part of the google sheets api credential we just created code code secret code valid for 60 seconds after obtaining it finding client id client id and client secret client secret from within google api console navigate to the credential tab, and click the credential you've just created make sure you have the right project selected now copy the values for client id and client secret and save them for later preparing the request now that we have the client id and client secret ,we only need to get the code code so that we can use it to receive the oauth token the code has a 60 second 60 second validity so before obtaining it, we'll prepare a request in postman so that we can just obtain the code & send the request straight away open postman and configure a post request with x www form urlencoded body type post https //accounts google com/o/oauth2/token https //accounts google com/o/oauth2/token set the following key value pairs grant type ➜ authorization code code code ➜ here you need to add the code we obtain in the next step here you need to add the code we obtain in the next step client id client id ➜ value of client id that you saved client secret client secret ➜ value of client secret that you saved redirect uri ➜ https //procesio com/ https //procesio com/ access type ➜ offline getting the code code the request is ready to be sent and only needs the code code to obtain the code you need to build an url as per below https //accounts google com/o/oauth2/auth?access type=offline\&prompt=consent\&client id= yourclientid \&response type=code\&scope=https //www googleapis com/auth/spreadsheets\&redirect uri=https //procesio com/ https //accounts google com/o/oauth2/auth?access type=offline\&prompt=consent\&client id=yorcientid apps googleusercontent com\&response type=code\&scope=https //www googleapis com/auth/spreadsheets\&redirect uri=https //procesio com/ in the green highlighted green highlighted section you will insert the value of client id client id just like in the request copy the url & paste it into a browser this should prompt you to select a corresponding account to which resources will become accessible via oauth make sure to sellect the right account once you logged in, press the allow button after allowing, you’ll be redirected to a screen that should look something like below this new url (on which you were redirected) contains the code to be used in postman for obtaining the access token as well as the refresh token (we have about 60 s until the code expires) (we have about 60 s until the code expires) complete your postman request by adding the code and hit send you have now obtained the access token access token and the refresh token refresh token make sure to save them πŸ’ͺ the access token expires in one hour so a refresh mechanism needs to be put in place more on how to refresh the token here using procesio with google sheets (append demo) build a basic process with start ➜ call api ➜ stop create a rest api credential with the base url https //sheets googleapis com/v4/spreadsheets https //sheets googleapis com/v4/spreadsheets we are going to skip testing the credential create some variables in your process name type default value single value set as token string string bearer access token access token βœ” sheetsapistatus integer integer βœ” output sheetsapibodyoutput json json βœ” output configure the call api action as follows verb ➜ post methodname ➜ /spreadsheets/{sheetid}/values/a1\ append query params key value valueinputoption user entered headers key value authorization token body { "range" "a1", "majordimension" "rows", "values" \[ \[ "sample value" ] ] } run the process & check your spreadsheet more details on the google sheets api can be found here stay tuned as we are working on preconfigured call api actions with google sheets