Hi guys,
I have a created a template with conditional formatting (color, letter style etc.) and run it using "run command". I was successful in combining my data with the template however I failed in renaming the file. When I rename it using the formula tool, it creates a separate file with no conditional formatting.
Can anyone help me how to rename my file without removing the conditional formatting? The format of the file is [Month Date] + "Filename" + [Datetimetoday]
Below are information of the workflow.
Looking forward for everyone's expertise on this.
Thanks,
Kamen
Solved! Go to Solution.
@KamenRider , Here is a link to a similar problem resolved before. Please look into it and let me know if it was helpful.
I think we have quite different case. A text input file containing the location and filename of the template is connected to the run command and I have another file containing the data to merge with the template. I am looking the workflow you have sent but I can't determine on how I can rename the filename. Will reg_replace help in renaming my file without removing my conditional formatting?
Please advised,
Kamen
Hi @KamenRider
This macro is able to rename files without modifying anything of the file: https://community.alteryx.com/t5/Community-Gallery/Rename-files/ta-p/998942
INPUT of filepaths to be renamed (example):
FileCurrentName | FileNewName |
Output.xlsx | Output_20220102.xlsx |
SAPExtraction_16cefd9e6da78821d90d713c46f1d056.txt | SAP_20220102.txt |
Report_Qlik_Dashboard.pdf | Report.pdf |
Hi @KamenRider
Picking this up from our other thread, i think what your workflow is currently doing is this:
To correct this i think what you will need to do is move the Formula tool which creates the filename to earlier in the workflow, such as in the example below
This then keeps the filename/filepath consistant across both the Run Command tool and the Output tool.
HI @Felipe_Ribeir0 @DavidSkaife @grazitti_sapna
I've checked the macro and I've encountered an error. Please be advised that I have three templates and thereby would be renaming the 3 files. for example
Singapore Report
Taiwan Report
Hawaii Report
rename to
Month Date + Singapore Report + Date today
Month Date + Taiwan Report + Date today
Month Date + Hawaii Report + Date today
Note that I need to retain the conditional formatting. Just need to rename the filename.
Please see below errors I've encountered.
Please advised.
Thanks,
Kamen
Hi @KamenRider
Sorry, just looking at this print i was not able to know what is wrong. I tested it here and it is working fine.
See if your FileCurrentName and FileNewName (formula tool) are providing valid filepaths for all rows:
HI @DavidSkaife @Felipe_Ribeir0 @grazitti_sapna
My current workflow doing in sequence.
1. I have created folder for my templates. The text input tool you see below consists of the input file of the template and the output filename. The "run command" copy the templates to the output folder.
2. Then I have an input file containing the raw file which do the processing to produce data to merge with the templates in the output file. The part of this process produce 3 excel files.
3. My problem is that when I used the formula tool to indicate change in filename, it creates a separate file with no conditional formatting together with the other 3 files with conditional formatting. So I produce 4 files instead of 3.
Will try your advise @DavidSkaife . Will let you know if it is succes.
Thanks,
Kamen
I not sure why it has error. Does your macro can rename multiples files regardless of how sheet tabs I have. Another questions is that, why is it being converted into zip file?
I do hope we can solutions to this.
Thanks,
Kamen
Hi @KamenRider
The zip is just an example, the macro can rename any given file. See if you can run the attached example, that rename multiple xlsx files. If yes, try to understand how the formula is working to provide the FileNewName column, and then adapt it to your use case.
BEFORE RUNNING IT
AFTER RUNNING IT