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.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions