I have a pretty straightforward form that is inserting DateTime variables from a SharePoint list but whenever they print to email, the data always includes the time as well as the date - which is not something that was included, so it always shows up as “12:00:00 AM”. Ideally, I’d like to format that out - but so far I havent found a way to do that.
For example my Input would be:
and the output is:
SharePoint settings are as follows:
Best answer by bamaeric
Another option is to use a Regular Expression action to remove everything after the date.
Here is how to do that:
Add a Regular Expression action to the workflow.
Configure this action with these settings: - String = Date of Request - String operation = Replace - Pattern = \s[0-9]+:[0-9]+:[0-9]+.{3}$ - Replacement string = Leave empty - Output = txtDateOnly (this is a text workflow variable that you create)
This returns only the date with the time, AM/PM, and spaces removed.
You can then use this text workflow variable in your email.
Another option is to use a Regular Expression action to remove everything after the date.
Here is how to do that:
Add a Regular Expression action to the workflow.
Configure this action with these settings: - String = Date of Request - String operation = Replace - Pattern = \s[0-9]+:[0-9]+:[0-9]+.{3}$ - Replacement string = Leave empty - Output = txtDateOnly (this is a text workflow variable that you create)
This returns only the date with the time, AM/PM, and spaces removed.
You can then use this text workflow variable in your email.