Tuesday, September 19, 2017

Nintex Repeating Section Date/Time - Using in an email or a string builder





Problem

Date and Time often challenge in any development works, recently I experienced some challenges in Nintex repeating section.

Scenario:

I built a Nintex form with repeating sections which have a date and time field. The repeating section store the data in XML format.  A running workflow read the repeating section data to construct an email body.
 I queried the XML and try to store the values to workflow variables. Then I use a string builder to write the contents of my email. Everything went very well except the date. J

When I had a deeper look, I found-out Nintex write dates in MM/DD/YYYY format and my SharePoint environment in DD/MM/YYYY. Nintex has a detail explanation for that. You can find here. https://support.nintex.com/SharePoint/Forms/2016/Date_Format_in_XML_of_Repeating_Section_is_Always_MM%2F%2FDD%2F%2FYYYY_With_Query_XML_Workflow_Action

Solution

Query and store the date field value into text variable. Make sure return result as “Text”



Then, use “convert value” to another variable which is date time type variable.



You need to convert as follows.
Input-- > date-time variable – text type
Store in date time Variable – date time type
In advance – use the US culture. So that it will read the text field correctly. However, it will store as per your SharePoint regional settings.




Now, we can use the stored date time field in the string builder or in emails.