How to append formatted date to file name?
Comments
-
Is there a built-in way to add a formatted date to a filename? I want the date in format YYYY-MM-DD, and I want to maintain zeros as part of the date. For example, today is 27 August 2020, so that would be 2020-08-27. For example, 1 September 2020 would be 2020-09-01.
I’m able to use a “Replace Text in String” step to add the date, but the leading zeros in the month and day elements are lost. I am using Merge Plain Text for the “new Text to Insert” element of that step, and I’m using the following fields to get the current date:
[ul][li]Flow Data.StartTime.Year.Unformatted[/li][li]Flow Data.StartTime.Month.Unformatted[/li][li]Flow Data.StartTime.Day.Unformatted[/li][/ul]
I tried using Data.StartTime.Month.Default, but I still lose the leading zero. -
[font=Roboto, Arial, Helvetica, sans-serif]Ive created an example of how you might update the filename of documents with the current date at a constant length. Feel free to import, review, and modify it at your convenience. The key factor is that current_date.month and current_date.day will always be single-digit if the month or day is 9 or below. This example checks these values and adds a preceding zero XOR the date/month is < 9.[/font]
Howdy, Stranger!
Categories
- 4.4K All Categories
- 81 General
- 13 Training
- 209 Installation / Setup
- 1.2K Flows
- 110 Rules
- 270 Administration
- 213 Portal
- 497 General Q & A
- 711 Forms
- 346 Reports
- 3 Designer Extensions
- 48 Example Flows
- 58 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 187 Pages
- 5 Process Mining
- New Features
- 186 Datastructures
- 70 Repository
- 230 Integrations
- 29 Multi-Tenant
- 27 SDK
- 81 Modules
- 59 Settings
- 26 Active Directory
- 12 Version 7
- 35 Version 8
- 143 Lunch And Learn Questions