View Transcription

Audio Duration: 10:00

Using the Alteryx Gallery API


Hello there! Welcome back to another Data in the Wild episode hosted by Data Meaning. Before we begin, don’t forget to subscribe to the channel below, click the bell to turn notifications. To be the first to know every time we upload a new video.


Today, I’m going to explain really briefly how to download all the workflows from your server, if you need to pass it as an admin server using Alteryx designer with the Alteryx gallery API. So, let’s check really quick. Here what I’m doing in this workflow, I’m not going to build the workflow from scratch. But it’s a really simple workflow, and just need to be careful with a set of configurations that you need to do. But this should be a really easy process. So, let’s start with the text input tool and see what I have here. What I have here is basically I’m using workflow casting to reference my endpoint. Now I’ll be using to call the gallery API. So basically, in my workflow constants will populate the gallery base URL and the endpoint. So, I have a list of all the endpoints that you can get. But you also can find that in your gallery documentation. It’s isn’t simply just need to open your gallery home, and basically access the question mark icon, where you can open the API documentation, and you will find all these costs. I find it easier to just list them all. And in Text Input Tools, I can easily change my workflow constant that are into. 


So good after that, I’m going to add an Alteryx gallery API runner to which it can be found in the community. It was double up by Patrick Bacon. This is a really easy way to make gallery API calls using Alteryx designer. So, you’re gonna add your key here, remember that you were using an Admin API call, which will be this one, to get all the workflows, find all the workflows in the gallery, and see if there is a difference between this one, and this old one, which basically, the old one will return all the versions of the workflows, this one will just return the published version. So be careful with that. We’re just using this one to. So, we don’t over complicate this. But if you wanted to find different versions of the same workflow you could use, the second one they use is all in here. So nice we fill this out, it’s really quick and simple. We’re using a get request, as it says on documentation. We’re outputting that to string. After that, we’re going to add a JSON to. That we’re going to add the result of our API call, which is basically the download data field that we already see coming out from download. This one will be added here, it will parse the JSON. After that, we’re going to use Regex Parser Tool. 

Running the Alteryx Workflow


We’re going to parse the JSON name. And let me run that so we can see that. I deactivated second quarter of data. I’ll explain that in a second. But basically, we’re going to do with these two parts. One is just download just getting, returning the IDs of the workflows, and then downloading one for time. So, let’s do that. We’re gonna run this workflow really quick. You can see the workflows running. And let’s see what we did here to understand the data. Of course, this is done in multiple steps where you’re going to be building out your workflow and you’ve seen the data and that’s what the data looks like basically. We have a JSON named and adjacent value stream that is generated by JSON. So, what we need to do here is basically isolate some of the fields that we’ll find interesting, like file name, like the idea of the work that we need to make the second call, to download the workflows, and basically that’s it. We also need to isolate that number here, because basically, this will buy every information related to that specific work. We’re going to use a Regex here, it should be an easy Regex, we’re basically getting capturing the digit front of the description of the film. Then the rest of the beat, go counter to the fields that we’re trying to parse. 


I designed here, some workflow, like the number of the workflow, let’s say and feel tattered. So, we can use across that tool later. So, after that, if you find it, we can see that we have all the field headers here and group them, and we can assign them the value stream to make them look better. In a better format. We use a crosstab to hear group of data by workflow, like I mentioned, like these numbers. They don’t really mean anything, but we’re just grouping them. And in assigning an ID basically, and route using the field header column that I created, parsing as headers, and the values for the new columns, and JSON values, just to be used first, as my map for aggregating values, that shouldn’t be an issue. What we get here basically, there is a table with all the information from every workflow, like subscription ID, published version owner, the meta info name, which would be a really nice thing to have. If you have more information around that workflow. And all those kinds of stuff, you can find, most importantly, the IP of workflow, that’s what we need to make the second API call, the file name is good to, because it’s going to use that to create our file names later. 


So basically, we did that, we are going to continue here, we can see in the Select tool that we have workflow, filename, that interests me ID, which I’m going to use in second call. I can also bring that information just to see what this we’re related. So, we’re going to open the second container, which is basically the second part of our multi step workflow that we have for downloading workflows from the gallery. What I did here is it filtered a little bit, because I don’t want all of the workflows, there are a lot of workflows in the gallery, but if you want to back them up, it would be a good idea to have this running and backing them up and swing them somewhere safe. Something happens through server, if something happens, you have all the workflows located at the same place, maybe. So, this will be a best practice to have worse, and you can see that it’s not hard to fill that out. Moving forward, I’m going to filter the subscription name as Data Science, which is one of the subscriptions that I’m always moving to basic needs team studio. This is going to filter my workflows that are in this subscription. After that, I’m gonna use Formula Two here. 


I’m gonna basically modify a little bit by file name because those file names come in as SDR, for example, there are apps that will be with the extension of “yxwz” you can see here or if you’re very close by “yxmd”, or macro, there will be “yxmc” and so on. So, what we need, we’re not going to download just that file. We’re going to download the whole package when we deal with API, when we do a server. General server once the package you know like all just not the main file that you’re dealing with, but all the assets that are associated with that file base. So, we’re gonna rename that file name to like CP using the substring function, which should be easy to understand. But if you have any questions that search for that function, but you’re basically replacing the extension that you find whatever it is, with “yxzp”. Which is the package extension. The second form would basically reference your user gallery, this URL that we define here in the group called Constant Menu. Also, it would reference the second call, which will be download all the packages based on an IP that server creates for that package. The ID view will be a key field [Inaudible 10:57] if we think, because that’s how servers can recognize your workflow, and it’s gonna make the call properly. 


So, after that, we’re just going to use a second got allotropes, go API runner two, we’re going to use the endpoint URL download workflow field that we just created here, that’s basically going to call every time you run that workflow. Every time basically, the macro finds a different ID word. Right? So, you have the key, again, the secret, it’s the GAD method. And the different suits not a string anymore. It’s a blob, because we’re downloading an object. Okay, so after that, the final step will be easy enough. And you can save that to a specific location, but what you’re going to do is you’re going to replace the file name with a few, okay? Because you basically using the filing feel that you’re creating here. And you’re going to use the blob field as download data to that comes out of the macro. Okay, so let’s run that and see what happens. I can hit run here. So, what I did, basically, I added a sample to here just so I so it doesn’t take too long. There were too many workflows here. But I’m going to hit run, show it to you. And I basically sampled for sim work. Let’s see what happens. See what’s going on. It was really fast because of the size of the workflows, probably. 


But it basically had all these packages refund written from blob file using the blob out tool. As you can see, they were saved in this folder, here that I actually set it up here, you can do it dynamically to if you replace the entire path, you’d have to build off that path again, as well. But if I open basically file open my folder here, I will be able to see that the [Inaudible 13:39]. So, guys, that was an easy way to download the workflows from the gallery use the gallery API, and Alteryx designer. So, I hope you enjoyed that. If you have any questions, please let us know. If you have any questions or suggestions for future videos, please comment below. Don’t forget to subscribe to know when future videos are posted. Thanks for watching.


About Data Meaning

For more than 20 years, our management team and consultants have implemented disruptive business intelligence solutions and made bold moves to drive profound business transformations. In partnership with the world’s leading companies and spanning across 15 industries, our team is proud to have struck the balance between industry knowledge and business intelligence expertise to help institutionalize more effective analytically powered business transformations. Thus, the intersection of industry knowledge and business intelligence is not just what we do but is a fundamental part of who we are and what our partnership has to offer.

We deliver end-to-end solutions for our clients and are industry leaders in user experience design, customizations, and training. Start to finish, every project we tackle is focused on delivering the exact intelligence and insight your organization needs to impact performance and achieve the outcomes you care most about.

Get in Touch With Us

Follow Data Meaning on LinkedIn, YouTube and subscribe to our email newsletter for more new content and live webinars.

Would you like more information about how Data Meaning can empower your company with informed decisions? Click the button below to request a free strategy consultation today.

Request Free Consultation