> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-transformations/available-transform-functions/date-transform-functions/custom-dynamic-date-transform-function.md).

# Custom dynamic date transform function

## Introduction

The **custom dynamic date** transform function is used to set a target field to the current date and time, based on the date and time that the process flow runs. You can also define rounding and adjustments.

## Adding a custom string transform

**Step 1**\
In your process flow, access settings for your map shape:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FWVyqnULF7g5M3Pd7G8aN%2Fcustom%20string%201.jpg?alt=media&amp;token=ff64e072-de9d-409d-b428-5d8ccfc9fdad" alt="" width="261"><figcaption></figcaption></figure></div>

**Step 2**\
Select the **add transform** button for the required mapping rule - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FxOOae75HpSijTH2Ou8AJ%2Fmap%20transform%203.jpg?alt=media&amp;token=9f624f78-9604-47d4-b599-86d75760b7ce" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 3**\
Click the **add transform** button:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F3Ua8TKaE4TZFejZDXzLl%2Fmap%20transform%204.jpg?alt=media&amp;token=9ad403ed-d029-4c81-ab5c-ee9839b6316d" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 4**\
Click in the **name** field to access a list of all available transform functions, then select **custom dynamic date**:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Frn6bR3RvCer3crfDhSwr%2Fcustom%20dynamic%20date%201.jpg?alt=media&amp;token=98949a4f-6fe4-48c1-b716-72bdc277fd00" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 5**\
Optionally, you can add adjustment settings - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FOYmupeADw0PnsRwweluy%2Fcustom%20dynamic%20date%202.jpg?alt=media&amp;token=becfff44-0ff4-4a19-8bff-9d28151a8052" alt="" width="375"><figcaption></figcaption></figure></div>

These options are summarised below:

<table><thead><tr><th width="260">Field</th><th>Summary</th><th>Example</th></tr></thead><tbody><tr><td>Round</td><td><ul><li>Select <code>start of day</code> to change the time to <code>00:00:00</code> for the date the process flow is run.</li><li>Select <code>end of day</code> to change the time to <code>23:59:59</code> for the date the process flow is run .</li></ul></td><td>Suppose that the process flow runs at the following date/time: 2023-08-10 10:30:0<br><br>If set to <code>start of day</code>, the transformed value would be <code>2023-08-10 00:00:00</code>.<br><br>If set to <code>end of day</code>, the transformed value would be <code>2023-08-10 23:59:59</code>.</td></tr><tr><td>Units</td><td>If you want to adjust the date/time, select the required unit - choose from <code>second</code>, <code>minute</code>, <code>hour</code>, <code>day</code>, <code>week</code>, <code>month</code> or <code>year</code>.</td><td>Suppose that the process flow runs at the following date/time: 2023-08-10 10:30:0 and you want to adjust it by 1 day.<br><br>In this case, you would select <code>day</code> as the <code>unit</code> and specify <code>1</code> as the <code>adjustment</code> value. However, if you wanted to adjust by 1.5 days, you would set the <code>unit</code> to <code>hour</code> and specify 36 as the <code>adjustment</code> value.</td></tr><tr><td>Adjustment</td><td>Having selected an adjustment unit, enter the required number of that unit here.</td><td>See <code>units</code> examples above.</td></tr></tbody></table>

**Step 6**\
Accept your changes:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FFGqbaxqmslgEjPuTbTJn%2Fcustom%20dynamic%20date%203.jpg?alt=media&amp;token=cbfc2dbb-4bd1-499a-ada4-76cf3082e03b" alt="" width="375"><figcaption></figcaption></figure></div>

...then save the transformation:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Faky5enBfFvlEbYw2sPUm%2Fcustom%20dynamic%20date%204.jpg?alt=media&amp;token=ca4a2848-a2a5-40c6-9d0c-e1cd66c25623" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 7**\
Now you can select a target field in the usual way - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F0G9pBLadeeQDDdkqsBTb%2Fcustom%20dynamic%20date%205.jpg?alt=media&amp;token=20084a34-da12-4c38-aa31-8bd8d021676a" alt="" width="375"><figcaption></figcaption></figure></div>

...then:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FX11SnnAvt2X4kWENGv97%2Fcustom%20dynamic%20date%206.jpg?alt=media&amp;token=c495aa9d-fd73-4cdc-8b79-f2cece39db73" alt="" width="375"><figcaption></figcaption></figure></div>

...then:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FZd2ALWQw7GznuEIg3X66%2Fcustom%20dynamic%20date%207.jpg?alt=media&amp;token=88cd0684-15ee-44e6-bd1b-a9f907017733" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 8**\
Once your mapping is complete, the row should be displayed without a source field - for example:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FhwWU2Hyel6iWoClwYN4A%2Fcustom%20dynamic%20date%208.jpg?alt=media&amp;token=ffd9fd94-8b66-4379-8fac-284ba319f1e2" alt="" width="375"><figcaption></figcaption></figure></div>

From here you can save changes or add more mapping rules as needed. Next time the process flow runs, the **custom dynamic date** will be mapped to the given target field.
