Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic Rename -- Filename

jbeckie
6 - Meteoroid

I've searched the community prior to posting this and have not found a solution yet.

 

I am trying to append datetimenow() to an original filename, using a formula tool to create a new complete fullpath (i.e., C:\Users\...\OneDrive ...\Alteryx -- K + J\Automated Swipe Extract for Vendors\Output Files\Sample Input 2022-05-06 09:09:26.xlsx|||No Match).

 

I then point the output tool to the fullpath, using "Change Entire File Path."

 

Please see the attachments and let me know if you require any clarification.

 

Any help would be greatly appreciated!

9 REPLIES 9
Luke_C
17 - Castor

@jbeckie What's the issue you're running into?

jbeckie
6 - Meteoroid

Oh good point @Luke_C

 

The error code is attached here

rfoster7
9 - Comet

you'll need to format [datetimenow] into a format that is supported the filename. I recommend _ instead of :. Can't put colons in filenames. 

 

Something like. 

 

 

"C:\users\xxx\OneDrive - XXX\Alteryx\XXX\Output Files\" + [FileName] + " -- Output" + datetimeformat([DatetimeNow],'%Y_%m_%d_%H_%M_%S') + ".xlsx|||No Match"

 

 

You also have two + between your [datetimenow] and your ".xlsx" which might also cause a problem. 

 

 

 

 

IraWatt
17 - Castor
17 - Castor

Hey @jbeckie,

The issue is your not allowed ":" in file names but you need to make sure the "C:" Drive colon remains for it to work

jbeckie
6 - Meteoroid

@rfoster7 perfect you solved the issue, which was improper format for filename. I should've known about the colons being disallowed.

 

Another question is how to write multiple tabs to the same file? I'm sure there's something within the output tool that I'm just not doing properly.

 

 

jbeckie
6 - Meteoroid

@IraWatt thank you kindly as that was the issue (the colons being disallowed in filename)

IraWatt
17 - Castor
17 - Castor

@jbeckie Your set up seems fine to write to multiple tabs just specify them after the three "|||"

IraWatt_0-1651851670783.png

 

jbeckie
6 - Meteoroid

@IraWatt Ok thank you it seems to be working now!

IraWatt
17 - Castor
17 - Castor

Nice :) glad it worked! can be really finicky getting file paths to work  

Labels