cancel
Showing results for 
Search instead for 
Did you mean: 

Date Stamp a Repeating Control

bburke
Nintex Newbie
3 5 1,822

I had a lot of difficulty placing a date stamp on a repeating section entry.

aditya gandhe presented a solution Repeating Conrol + Current user Name + Time that included Current User and Time but it was more than I needed.

With some help from my colleagues on our development team, I'll document how we date stamped multiple repeating section entries.

First, on our form we placed a repeating section, inside that control we place a date/time control.

https://community.nintex.com/servlet/JiveServlet/downloadImage/190226/pastedImage_0.png

In the properties of the date/time control we set the Default Value to "blank" and Date Only to "Yes".

https://community.nintex.com/servlet/JiveServlet/downloadImage/190227/pastedImage_1.png

In the properties of the Multiline Textbox nested in the Repeating Section  create a control named "control-class" (of course you can name it what you want).

Ensure you connect the repeating section to a list column.

https://community.nintex.com/servlet/JiveServlet/downloadImage/190228/pastedImage_2.png

In the form settings, insert the following in the Custom JavaScript section:

NWF$(document).ready(function(){ 

NWF$(".control-class").on('change', function(e) {

var timestamp = new Date();

NWF$(this).closest('.nf-repeater-row').find('.nf-date-picker').val(timestamp.format('MM/dd/yyyy'));

});

});

https://community.nintex.com/servlet/JiveServlet/downloadImage/190229/pastedImage_5.png

Publish your form. If you enter text in the repeating section multiline textbox, the date/time control will not update until the focus changes to somewhere outside the multiline textbox.

This includes: If the user enters text in the multiline textbox, leaves the focus there and selects "Save", the focus will change and the date stamp will be saved to the form.

Additionally, if the multiline textbox is modified, it will update the date/time control.

Hopefully this will be useful to you somewhere down the line.

5 Comments
Automation Master
Automation Master

I presume as the event is on change, it will also update if a user updates the multiline text box, do you know?

bburke
Nintex Newbie

Ryan,

That's correct, if that multiline textbox is modified, it will update the date/time control to the current date.

Thanks for that, I will add it to the post.

hagarm
Nintex Newbie

Thanks for the post!  It seems to be working fine, but I thought that the current date would save for each repeating line.  The date shows up when the form is being filled out, but once the workflow is in progress, the dates disappear.  So when you open the form for edit, the dates are all cleared out.  Is that how you intended this to work?

bburke
Nintex Newbie

Michelle,

Ensure you connect the repeating section data to a list column. ( I updated the post to reflect that. New image: Control Settings - Repeating Section)

Thanks for catching that, let me know how it works out.

Bill

hagarm
Nintex Newbie

Thanks Bill!  I think I got it working!