Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Action tool to replace folder browse location

HarriDhillon
6 - Meteoroid

Hello,

 

I have setup a workflow where I want the Action tool to allow the user to run the Analytic App and select the save location for the output.

 

In 'Select an action type' I have selected 'Update Value with Formula', selected the output location, and entered the formula as:

 

Replace([Destination], "C:\Users\XXXXXXXXXXXXX", [#1])

 

However, when running the app, it still saves the output in the original folder location, even though I select a different location? I even tried 'Update Value (Default)' and ticked the box to 'Replace a specific string' and entered the above folder path in quotes, but it made no difference. 

 

I have used the 'Update Value with Formula' method before and it works, the only difference is before the outputs were rendered .xlsx files, and this times its a .txt file, but surely that shouldn't make a difference?

 

Screenshot 2023-11-15 114117.jpg

10 REPLIES 10
DataNath
17 - Castor

@HarriDhillon wrote:

I even tried 'Update Value (Default)' and ticked the box to 'Replace a specific string' and entered the above folder path in quotes, but it made no difference. 


Hey @HarriDhillon - try this part again but without quotes. In the 'Replace a specific string' configuration you only want the actual text that you're replacing, no need to quote it as if it's part of a formula. Mine would look like this for example:

 

1237.png

HarriDhillon
6 - Meteoroid

Hi @DataNath 

 

I just tried that, and although it doesn't save to my original folder location, it doesn't save it in the new specified location either.

DataNath
17 - Castor

Hmm it does look like the configuration is right - I've just tested this using a .txt file and got it working fine. Is there any way you can attach your workflow or at least a snippet of the final bit with some mock data? I've attached my dummy app to look over in case that helps.

HarriDhillon
6 - Meteoroid

I've created a dummy workflow, and used the same formula logic in the Action tool. So when I run the app and select a Save To location, it doesn't actually save there.

DataNath
17 - Castor

Ah I see the issue now @HarriDhillon - you're replacing everything including the filename. As you're using the folder browse, you only want to replace up to the final directory i.e. 'Output' in the example you just attached. That way, only the folder structure will be changed in the filepath when you run the app - have amended and attached the flow above:

 

1238-2.png

HarriDhillon
6 - Meteoroid

Funnily enough that works on the Test workflow, but not on my real one. I'm doing the same thing, I'm only replacing everything up to the file name and it still doesn't work.

 

My full path is C:\Users\XXX\XX\File Name.txt

 

Therefore my formula uses "C:\Users\XXX\XX\XXX"

 

Screenshot 2023-11-15 161906.jpg

Screenshot 2023-11-15 162308.jpg

  

DataNath
17 - Castor

@HarriDhillon if the full path is My full path is C:\Users\XXX\XX\File Name.txt

 

Then you should replace C:\Users\XXX\XX, rather than C:\Users\XXX\XX\XXX

HarriDhillon
6 - Meteoroid

I did a bit of experimenting, and it looks like the problem lies within the Output Data tool.

 

I am selecting the 'Take File/Table Name From Field' option, and selecting 'Change Entire File Path', and it still saves to my original folder location (after I've updated the formula as mentioned above).

 

However, when I select any of the other options (Append..., Prepend..., Change File...) then it DOES save the output to a new specified location. Not sure why this would make a difference? This only solves half the problem, as although I can now save the output where I want, I need to use the 'Change Entire File Path' option in order to preserve a dynamic naming convention.  

 

Screenshot 2023-11-16 154052.jpg

 

 

 

DataNath
17 - Castor

@HarriDhillon are you able to share the workflow? Or at least the Formula expression and the Action tool setup of how you're changing this?

Labels