How to Update File Name and File Path of an Output using Action Tools
- 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
So, I'm trying to add action tools to my output data tools. When choosing to run as analytic app, I'd like to be able to: 1. Update the name of the output file AND 2. Update the file path of the output file.
We save a lot of files by the year, month, etc.
Looked all over the board, I couldn't find a way to get it done.
Anyone got a solution?
Solved! Go to Solution.
- Labels:
- Developer
- Interface Tools
- Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
One approach I normally use is to create a "file_name" field which would contain all the details I want. So, if I were creating a file name based on a date and a text box input, I first use an ACtion Tool to update the value in a Text Input tool which has a single value in the field: FILE_NAME which looks like:
'input1-input2'
I would then choose to replace a specific string, with each of my inputs. This string would be input1 or input2, depending on the format I want my filename to be. Doing so, you can get something like:
"Invoices-2018-09-17"
I would then use Append Field to append this to every record, and then use the output tool to change filename based on the FILE_NAME field.
Let me know if this would work for your use-case,
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! This will work in changing the Name of the Output File. Obviously, this adds an additional row of information and additional work outside of Alteryx to remove the unwanted column again.
However, it does not let me change the File Path to a New Location within the company servers, which would have been nice given the size of the files.
It will work for the time being, and then I'll just have to manually move my files after they've been saved. Small step, but I was really trying to keep from having to mess with the workflow outside of the analytics app after the workflow was built.
Thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@rspear,
If you use the technique the @tcroberts is using, you can have Alteryx not include the FILE_Name field within your data.
You also have the option of using the the Events command line to move your files if needed after the app completes. Batch-Files-in-Alteryx-Part-2-Moving-Files
The reason why we do not allow the File Browse tool on the Alteryx Server is due to security. At this point we don't have a way to permission that tool per user within the server.
Hope that helps
DanM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Glad I could help!
As for your second issue, changing the path to a new location; you should look at relative paths.
I'm not sure if you'd want to move them all to the same location, but let's say the workflow is stored in the following path: C:/Users/rspear/Documents/Alteryx/workflows
You want to move the output to C:/Users/User2/Documents.
You enter something like:
../../../../User2/Documents/
into the "Output File" textbox, and then select "Appending Group to Filename" as the method of Modifying filenames.
This would allow you to move the files around within the computer that the workflow is running on. If you're looking to relocate them to a remote server, you should look into using UNC paths which you can read about here: https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/Workflow-Dependencies/ta-p/49696
One other thing is that, if you're using an Output Data Tool, you could uncheck the "Keep Field in Output" to avoid having to manually remove that unwanted column in your exported files.
Cheers!
