![]() ![]() I know it sounds scary, but break it into tiny bits and don't get frustrated when (not 'if') things give you trouble. ![]() And, all of this is happening in the "Yes" path of your condition. I just threw something in the file content part so it wouldn't error, yours would be actual content. Ive seen a lot of samples but its not very clear to me. What this is doing, is grabbing a substring of characters starting at the left (position '0') and going until it finds the suffix part, and then backing up one space so it doesn't also grab the final period (that's the Add and -1 part).įinally, back in our Create File step, we drop the dynamic values from our FileName Prefix compose, followed by our date compose (like you did in your version), and then a period, and then the filename suffix compose. I want to create a script that will allow me top copy a file addign a date/time stamp to the file name, and delete the original one. You can copy and paste that into the expression for another compose (rename that one "filename Prefix") and replace all the bold bits with your dynamic attachment filename. That function looks like this (you would replace triggerBody() with your attachment filename dynamic value. If you watched my one video you'll already know that we can use Split() while using the period as a delimiter, but we may want to account for a filename that includes periods in the name, like, so we only want the last 'element' of the array that's created when we split the filename at the period. In my example, I'm using "Insurance Risk Assessment.xls" as the filename, so 'xls' would be the extension part. Once we determine that the filename has "Risk Assessment" in the filename, the first thing we need to do is separate the filename from the extension. There are some expressions, but if you're comfortable with Excel functions, these aren't too different. So, this is going to seem like a lot, but I'm going to be super detailed so you get the behind-the-scenes part and can apply it in the future. This helps other users find it more easily via buckle up. If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. So, there are a few ways to do this.this way uses the least amount of 'functions' and I'll be really detailed so I don't miss covering something you might want: This helps other users find it more easily via there. Here's what it all looks like:Īt the end, I used a "Compose" to store the information, and then you can drop that into the rest of your filename (pending on where/how you're storing the file). I used yyyyMMdd_hhmm which is the four digit year, followed by the 2 digit month (note the caps), then a 2 digit date, an underscore and then the time. In the format part, you can choose from the list, but none of those will work great as file names, so the best bet will be to go to the bottom of the list an select "Enter custom value" and then type in your own format. If you want to keep everything in UTC (if you're working internationally, as an example), then just set the destination to UTC also. Select UTC as the source time, and then your local timezone as the destination timezone. Next, add the step "Convert time zone" and use the output from your 'current time' step as the 'Base time'. We can fix the timezone and ugly formatting in the next step. This will grab the current date/time in a long format like this: T15:43:22.9817623Z - Note that this won't be in your local timezone unless you sit right in UTC or GMT. So, there are a few ways to do this.this way uses the least amount of 'functions' and I'll be really detailed so I don't miss covering something you might want:įirst thing would be to add the step "Current Time". Instead of a friendly long name, the file name got corrupted into this thing with squiggly marks. Without tunnelling, the associated long name of the file would be lost. It deletes the old "FILEWI~1.TXT" and creates a new one with the same name. You load this file into a program that is not long-filename-aware and save it. But internally, many programs save a file by performing a combination of save, delete, and rename operations (such as the ones listed in the linked article), and without tunneling, the creation time of the file would seem to change even though from the end user's point of view, no file got created.Īs another example of the importance of tunneling, consider that file "File with long name.txt", whose short name is say "FILEWI~1.TXT". When you use a program to edit an existing file, then save it, you expect the original creation timestamp to be preserved, since you're editing a file, not creating a new one. It's due to file system tunnelling, as explained by Raymond Chen: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |