Skip to content

Alteryx and Google’s OAUTH2: A macro to solve your problems

As you probably already know, Google is not just a search engine: the variety of cloud services and tools that it offers is constantly increasing. From email communications, file storage, document editing to web analytics, cloud computing, health tracking and maps, many aspects of your online life are most likely somehow related to Google’s services. The majority of those services can be easily used through a browser, and they provide some built-in analytics and reporting capabilities. But what if you want to integrate them into an Alteryx workflow? The use cases are endless: you could merge your on-premises datasets with your Google data, generate PDF reports and automatically send them to your customers through Gmail or analyze the email activity and response times of your organization.

Unfortunately, a major hurdle in using Google’s tools is the API’s authentication mechanism: it is not a simple matter of generating an API Key in your account and using that in all calls. Google is using a standard protocol called OAuth2, that offers much more features: you can choose specific Google services that your app will access, and grant different permissions; you can also allow offline access or one-time access, and more. But don’t worry! With the newest addition to our Macro pack, you will be able to get your authorization token for Google services in an easy, fast and safe way! You can simply follow the main steps outlined below or have a look at the embedded video.

https://player.vimeo.com/video/207628040

Using Inviso’s Google Oauth2 Macro

  • Head over to Google’s Developer console and create a new project.
  • Dive into the project’s credentials settings, click on “Create credentials” and select “OAuth Client ID”. You might need to create a “consent screen”. For a detailed guide, check Google’s FAQs.
  • Save the Client ID and the Client Secret – you’ll need them in Alteryx!
  • Open Alteryx, and insert the GoogleOauth2 Macro into your workflow.
  • Input the Client ID, and choose the scopes: you can enter it manually or you can choose from the default list. Based on the scopes, your application will have access to specific Google services.
  • Run the macro: it’ll open the Consent Screen with a summary of the Google services that the macro will have access to. In order to proceed, you need to confirm this choice.
  • You will be redirected to a new page that contains an authentication code. Copy this code and head back to Alteryx.
  • In the Macro’s menu, mark the “Step 2” checkbox and insert the code in the appropriate field. Then, add the Client Secret generated in Google’s Console.
  • Run the macro: you will get the “Refresh Token”. Copy the token (remember to copy only the token, and not the cell’s headers!).
  • In the Macro’s menu, mark the “Step 3” checkbox and insert the refresh token retrieved in the previous step.
  • If you run the Macro one more time you will get the Authorization token that will grant you access to your Google account.

Google’s Oauth2 doesn’t seem so scary now, right? Get this Macro (along with many others!) by downloading the Inviso Macro Pack for Alteryx. And stay tuned, we’ll publish a new Google Macro soon 😉