How to parameterized the source connection in Alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Guys,
I have created workflow that loading data from source to destination in local machine.
Path provided in both source and destination are hardcoded, I would like to parameterised the source and destination folder path so that if in future, if I need to change the path of the source and destination, I can only provide values to the source/Destination parameter and changes will get reflected into all the places.
Please suggest
Thanks
Amit
- Labels:
- Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @amsrivas ,
To parameterize workflows I would recommend creating Analytic Apps. Here is an introduction to creating analytical apps
I've mocked up a workflow that updates the source and destination paths via a File Browse GUI as well
Hope this helps!
Milos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is something like this what you're after @amsrivas? I've just built out a very quick example with a simple formula step in between to demonstrate - the key focus here is the File Browse tools affecting the Input/Output Data tools. As you can see from the pictures below, when I run the app, the user is prompted to navigate to a file to use as the input:
Before then entering a destination and file name/type:
The file will then save and you can also open it right away:
I've attached the app and dummy files in case you want to play around yourself and see.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Milos, Thanks for the response.
I have tried to access provided URL (introduction to creating analytical apps) but it is not working for me.
Also, I tried to execute (update-source-destination-with-file-paths.yxwz) however it didn't ask me to change the path of the source and destination.
I want something like as below
-> Let's source for Input directory is folder C:/A and if I want to change it to say folder D:/Z, then I want to have one Parameter say PARAM and will use it in place of path C:/A and make it referred wherever i path C:/A is used in the workflow.
Later, if i want to change C:/A to D:/Z then I will simply change the value of PARAM to D:/Z and it will change in all the places in workflow.
Thanks
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Datanath,
Thanks for reply.
I don't want to provide luxury to the user to change the path, instead I want to have one Parameter for source path so that If want to change the path of the source, I can simply change the value of the Parameter and it will change everywhere.
Thanks
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Amit,
Unfortunately, I think Datanath built out the solution I was conceptually thinking about as well. There's no good way that I know of to have those kinds of "parameter variables" outside of using the interface tools like in Datanath's workflow
Best,
Milos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@amsrivas my apologies, I thought you wanted a way for the user to change this, hence the Interface tool approach. If you just want a way of changing a single thing that is reflected in all areas that it's referenced, you could just create a new workflow constant by clicking on any whitespace on your canvas and navigating to Workflow > Constants:
Now, this [PathForFormulas] constant that I have created, holds the value next to it i.e.'G:\My Drive\My Documents\Alteryx\Community help' in my case. So when I reference this in formulas (I've just used it in 3 separate ones here to show how it works), this filepath is connected to that constant:
Therefore, to demonstrate how this would work for your use case. I now just need to change the value next to this new constant I've created for it to update in all the locations I've used it i.e. the 3 Formula tools:
Hope this helps! Please let us know if not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This really depends upon if you are using your workflow - or if you have an end user. If you have an end user - you want to configure a drop-down with the two alternatives and then connect those to your input tool via an action tool in an app. If you are using the workflow on your own designer- and you just want to toggle - you can manage your workflow dependencies and manually shift back and forth between those two locations.
If you are building for end users - you should go through the interface tools/Macro/App training offered by the interactive lessons. These are semi-complicated workflows and there is good deal you'll need to learn before you can build this kind of workflow.
