This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
A must-have for any app or macro, the Error Message Tool displays a prompt to the user based on input from Interface Tools . Using any expression that evaluates to true, along with any number of user inputs from question anchor connected Interface Tools, the Error Message Tool can layer even the most involved applications with failsafes that ease a user’s experience through more robust interactions.
... View more
The following steps detail how to obtain a client ID, client secret, and refresh token that can be used for authentication with Google related tools.
1. Open the Google Developers' Console
2. Login with the Google account associated with the data you would like to analyze
3. Create a new project by clicking the My Project dropdown (top-left corner) and selecting Create project (top-right corner of the pop up
4. Enter a Project name of your choosing and click Create
5. If you have not already enabled the Google API you will be working with, you can do so by navigating back to the webpage we started on, the Console Dashboard, and clicking Enable API:
For Google Analytics:
Other popular APIs >> Analytics API
For Google Drive:
G Suite APIs >> Drive API
6. After you've confirmed that your API is enabled you can obtain API credentials by returning to the Console and clicking on Credentials in the left-hand navigation pane next to the key icon
7. Click on the Create Credentials dropdown and select OAuth client ID:
8. Select the Web application radio button and add https://developers.google.com/oauthplayground as an Authorized redirect URI before clicking Create
9. At this stage, a pop up should appear where you can copy and save your Client ID and Client Secret
You can also find your Client ID and Client Secret by returning to the Developer's Console >> Credentials and clicking the name of the app we just created:
10. Go to https://developers.google.com/oauthplayground
11. Click on the gear icon in the top-right corner of the page and click the checkbox for Use your own OAuth credentials, enter the client ID and client secret from step 13, and click close
12. Copy/paste the respective scopes into the Input your own scopes field and click Authorize APIs
For Google Analytics
For Google Sheets
https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/drive.appdata, https://www.googleapis.com/auth/drive.readonly, etc
14. Click Allow
15. Click Exchange authorization code for tokens and save the Refresh token
16. Test the authorization by sending a request for an available operation from List possible operations
17. If successful, the client ID, client secret, and refresh token that you obtained in the prior steps can now be used for authentication with the Google related tools
... View more
This article is part of the CS Macro Development Series. The goal of this series is to communicate tips, tricks, and the thought process that goes into developing good, dynamic macros.
Many macros need to be especially dynamic to allow the user to select which field to use in a very complex process. Take the Make Grid tool for example. It asks the user to specify a spatial object field, and only carries that field through its calculations. What comes out of the tool are two new fields, GridName and Grid, and none of the original fields at all.
I set out to build a macro just like this tool, except to generate a hexagonal grid. I started by building a normal workflow that could do this process, and when I was ready to convert it to a macro, I realized that I wasn't sure of the best way to enable it to choose this field dynamically.
There are two main ways to get data into your macro. Here's a quick summary of how they work:
The Macro Input tool has a checkbox in its configuration that reads Show Field Map.
If this is unchecked, then your macro won't do anything with the data - it will just stream in everything as is and trust that the stuff inside knows how to account for anything you throw at it.
If it is checked, then your macro will create drop down menus in its configuration window that will ask for the fields you have present in the Template Input. These drop down menus will let you select which fields to stream in to the macro in place of the ones in its template.
The field map needs all those drop downs to be filled out for it to do its thing, but if you want to make one of these inputs optional, just add (Optional) to the field name in your macro template.
1. Easy to set up! One checkbox and your template are all that's needed.
2. Makes sure only mapped fields enter the macro. This is good when converting a workflow to a macro because you don't need to worry about every form the input data stream could be in. If your stream has other fields, they will get tacked on to the stuff coming out of the macro.
Drop Down menus are an alternative way you can bring fields into your macro that offers a bit more control of the process.
They're particularly useful when connected to the anchor of a Macro Input tool.
You can then update a Select tool with the selected field to choose which field is being passed along.
1. Allows you to specify which fields to show to the user from a list of field types. (In this example, I am only allowing spatial objects.)
2. You can have a default selection populate the interface. (Here we will have any field starting with "SpatialObj" get selected automatically in the configuration of the macro.)
3. If you want something to be optional, you can use the [None] option.
"The Select Tool Trick"
If you make use of the Drop Down tool to bring in your data you'll need to update a Select tool. Here's a little trick that will make converting your workflows a lot easier.
First you'll want to uncheck *Unknown in the Select tool, since this will bring in every field not explicitly unchecked here. Then, have only the field you're selecting for checked, and navigate over to your Action tool and point it at the selected field.
Instead of having this repeated for every tool using this field, just have the field renamed in the Select tool, and refer to it by that name in all your downstream fields.
This turned out to be just what I needed for the Make Hex Grid macro, where I have a ton of stuff happening downstream and I only wanted one field to get through my Select tool.
Check out the example for a simplified version of this.
... View more
The Auto Field Tool : a tool so easy you don’t have to do anything – just put it on your canvas and viola. Automatically optimized data types. If you’re running into data type related issues and errors in your workflows, or just looking to add some speed or reduce the occupied disk space your data is hoarding – look no further than the Preparation Tool Category ’s Auto Field Tool, which reads through all the records of an input and sets the field type to the smallest possible size relative to the data contained within the column.
... View more
One of the biggest reasons why people love Alteryx is that it has the ability to read a very large number of different data sources. This article includes a workflow that is able to read in non-natively supported formats like a Word doc or pdf by using a open source program to convert these formats to plain text.
... View more