I am trying to trim date/time extracted from SharePoint to date only and embed it in a message after Loop for Each.
The date/time field may be empty.
The message i receive is populating duplicate dates from a line item for blank fields. Is there a way to solve this?
Thank you.
Best answer by Garrett
Hi @mjliu
The issue is because you only reset the txtExpectedCompletionDate variable once (in the beginning) When you encounter a blank date value, you should reset the txtExpectedCompletionDate variable otherwise it will contain the value of the previous date.
There 10 rows. Only the first row has a filled date - 1-June 2023. The rest has empty dates. Because you do not reset the txtExpectedCompletionDate variable, the rest 9 rows (which is empty), will get the date of 1-June 2023
The solution. Just replace the Run-IF (highlighted) with a Branch by Condition.
Move the Format Date action into the YES branch. In the NO branch, set the txtExpectedCompletionDate variable to blank string
I assume after you Loop through each Item and Format the Date then you want to build a HTML text for each Date ...is that right?
or you can simply add ALL the format dates into one Text variable with each Date separated by semicolon ; so that you then RegEx it after the loop using the “Split” operation .
it would be great to see ( a screenshot ) of the “Create Text String” action what are you trying to compile as a text?
I was trying to create another column in SharePoint to convert date to text (calculated column) but not able to find this column in Loop for each to build the message. is it not supported at Nintex? I am able to see the column in Query a list action.
does the Format Date action return the Date format as :YYYY-MM-DD as expected? is that what you wanted to return? or it return different text value for the “Project Exp Completion Date” ?
The issue is because you only reset the txtExpectedCompletionDate variable once (in the beginning) When you encounter a blank date value, you should reset the txtExpectedCompletionDate variable otherwise it will contain the value of the previous date.
There 10 rows. Only the first row has a filled date - 1-June 2023. The rest has empty dates. Because you do not reset the txtExpectedCompletionDate variable, the rest 9 rows (which is empty), will get the date of 1-June 2023
The solution. Just replace the Run-IF (highlighted) with a Branch by Condition.
Move the Format Date action into the YES branch. In the NO branch, set the txtExpectedCompletionDate variable to blank string
The Format date to string requires a Date value. It works great I usually convert the “Current Date and Time” to into a string for humanizing DateTime output
With the 12-May NAC update, you (or your NAC admin) should be able to set the correct date format.