How-To Insert a Date into any Field
Overview
When you are sending a report to a stakeholder or automate uploading a file, you may want to include the current date or time in the file name to let your stakeholder know when the report was ran.
Steps
Navigate to a Task with a field that you want to include a date.
In the field, reference the Platform environment variables related to the Fleet or Vessel's Start Time. A full list of Platform environment variables can be found here.
Ex. ${MARKETPLACE_WORKFLOWRUN_START_TIME_YEAR}-${MARKETPLACE_WORKFLOWRUN_START_TIME_MONTH}-${MARKETPLACE_WORKFLOWRUN_START_TIME_DAY}
. This will return a string with year-month-date. Feel free to add any other information before or after the date setup, but never inside the ${}
environment variable reference.
f you need to reference the file name again downstream, we recommend using MARKETPLACE_WORKFLOWRUN_START_TIME variables because these times will be unchanging throughout the current run.
If you want the time to be different for every Vessel, use the MARKETPLACE_WORKFLOWRUN_START variables. This will require you to use regex match to find the file name downstream in the same Fleet.
If you need to reference the file name again downstream, we recommend using FLEET_START_TIME variables because these times will be unchanging throughout the current run.
If you want the time to be different for every Vessel, use the VESSEL_START_TIME variables. This will require you to use regex match to find the file name downstream in the same Fleet.
Other Date Examples
Here are some other general use-cases:
Example Output | Field Entry |
---|---|
report_09-21-2022.csv | report_ |
2022/09/report.csv |
|
1663769254_report.csv |
|
report_09-21-2022_14:07.csv | report_ |
report(14:07:34).csv | report( |