In the Generate Yearly report excercise you download a monthly report, save it into a temp directory (using a path that you have generated using the path.combine function and ‘save as’.
My problem is that even though I generate a valid path (as far as I can see) the file gets saved into my downloads folder (or whatever folder is the default folder when you open the save as file dialog) .
This is a problem as firstly, I’d obviously like the file to be saved where I want it to be not some random folder (current default) and secondly the temp folder is chosen so that in other parts of the process it can be destroyed and recreated empty to make sure that it’s ‘clean’ and I don’t want to be forced to do that with my downloads folder.
Here is my xaml (you’ll need to change the in_TaxID argument default value to a valid one for your data set)
System1_CreateYearlyReport.xaml (27.4 KB)
and here is what happens.
1 The data is fed in to the Download Monthly Report page (needs to be open) https://www.acme-test.com/reports/download
The Download Report button is pressed and a pop up opens with options (open, save, save as)
Save As is selected and ‘naturally’ opens at my downloads directory (you can see a report Report-R0212121-2017-1 has already been saved in there for some reason)
- The correct path for the file is entered and save is pressed and a message box appears saying that the file already exists (I think it is referring to the file in the downloads folder as if I delete that the save works)
In fact what is happening is that it always tries to save in the ‘Default’ path location.
The ‘default’ folder is the last folder that a file was saved into using the filedialog window. So if I manually hit the Download report button
and save it to My documents folder for example
next time I go to download the file and save as the file document folder will default to documents.
This shouldn’t be an issue as when the path is entered into the file name field the file should save there but it doesn’t (maybe there is a delay problem in that the save is occuring before the file name field has had a chance to be filled)
Going to put a delay of 2 secs in and see if that helps after the file name field is entered and before the save button is pressed.
That didn’t work and I should have known it really as once the workflow has got to the saving file point (in debug mode) and I even try to save the file manually (you can see it’s defaulted to the Data folder but the path in the file name field is the Temp folder, one level further down, which does not contain the file)
It is referring to the file existing in the data (default folder) and not the temp folder which is empty.
Does anyone have an idea what is going on here. It may even be more of a windows issue than UiPath but it still makes no sense
Additionally (using a different filename as had to reset data), if I manually change the name the file saves down fine into the temp folder (I really don’t get it!). See below
original pathname and press save (even though Temp folder empty) causes message that file already exists (it’s talking about the file in the data (default) folder).
but if I manually change the name (add -TEST to it) still saving in temp folder it saves down fine.
I know this is a long post but this behavior makes no sense to me.