Can you duplicate a repeating section in the same form?


Badge +3

I'm creating a work order form for our service department and they need to be able to basically create two forms in one. So i choose to use the tabs feature to create the two in one. However, I need to use a repeating section to add multiple product codes. The first "form" will include qty and our internal cost like this:

Nintex Forms.PNG

Now based on all the info on this form, the other tab is basically an order confirmation for our customer. So it will show the same product and qty but will need to list out the customer's price. However it seems it will only pull the first line in the repeating section:

Nintex Forms2.PNG

Is there a way to populate and show all the products on the second repeating section?


15 replies

Badge +16

‌ were you able to solve this in the end?

Badge +3

Unfortunately no I haven't

Badge +16

So is your project on hold or have you done something different?

Badge +3

It's on hold and we're using Excel files to get the work done until we can figure this out...it's not a high priority project right now...

Badge +16

Ah ok - I have a play and drag in ‌ to help me! 

Userlevel 5
Badge +14

first, maybe an idea on the other approach: what about not copying repeating section but make it common for both tabs? tab switching control would drive formatting rules to show either internal or customer price and other possible controls.

if you want to stick with copying, could you explain what did you try to make copy working and what make you stop?

just to know where should we start thinking from ...

Badge +3

I did that and the problem with that is the format gets screwed up when you go between tabs. Ad one of them we need to print as it's a customer acknowledgment we need signed.

I started by just copying the repeating section control in the form design and connected it to the original repeating section. Which didn't work. I've tried parsing the fields from a repeating section but that won't get me the final result I need so I stopped that and that was where I left it.

Userlevel 5
Badge +14

I think, if controls are carefully split into panels, it could have been manageable.

but ok, let's focus on repeating section duplication.

few more questions.

- does the functionality have to be strictly achieved in forms? to copy over one RS content into other would be much easier with workflow. I would assume that you print out customer copy from VIEW form...

- is it required that both RSs are editable? wouldn't it be sufficient if customer panel just displays data? if both have to be editable copy functionality would need to work in both directions and that make it quite complex since some extra checks would be needed.

Userlevel 4
Badge +7

Hi Jacob Barnett

I have come up with a solution which may help you.

I know its not perfect as it assumes the first repeating section is complete and the will be no additions or deletions after the second repeating section has been populated with data.


My first repeating section has a css class of repeat1

My fields in the repeating section have css classes of qty and val

My second repeating section has a css class of repeat2

My fields in the repeating section have css classes of qty1 and val1


I also have a button with set to button action of JavaScript and Client click of UpdateRepeater()


My form looks like this:

In the form setting under custom JavaScript, add the code:

function UpdateRepeater() {
    //Find each row in the first repeating section
    NWF$(".repeat1 .nf-repeater-row:not('.nf-repeater-row-hidden')").each(function () {
        //find the current row
        var $row = NWF$(this);
        //find the current row values
        var $input1Val = $row.find(".qty input").val();
        var $input2Val = $row.find(".val input").val();
        //Call function to update second repeater
        UpdateRepeater2($input1Val, $input2Val);
    });
    //delete extra unnecessary row
    NWF$(".repeat2 .nf-repeater-row:last").find('.nf-repeater-deleterow-image').click();
}

function UpdateRepeater2($input1Val, $input2Val) {
    //find the last row to update each time
    NWF$(".repeat2 .nf-repeater-row:last").each(function () {
        var $row = NWF$(this);
        //set the field value
        $row.find(".qty1 input").val($input1Val);
        //give field focus so calculated columns will work
        $row.find(".qty1 input").focus();
        //set the field value
        $row.find(".val1 input").val($input2Val);
        //give field focus so calculated columns will work
        $row.find(".val1 input").focus();
        //give field focus so calculated columns will work
        NWF$(".repeat2").find('a').focus();
    });
    //add new row
    NWF$(".repeat2").find('a').click();
}

Now add values and rows to the first repeating section, click the button and the second will be populated

nintex forms; javascript

Userlevel 6
Badge +15

Hey ‌! Did ‌'s solution help you out? Please mark it correct if so.

Cheers!

Rhia

Badge +10

Are you filling the second tab after saving the first tab?, If you yes you can extract the data from tab1 repeating section and construct a different xml with any controls that you need for the for the second tab repeating section using workflow.

Badge +3

It was helpful but unfortunately we do modify the form frequently so it's not an exact solution for our needs. We ended up taking the second part off and doing that manually since we have to print the form out for customers.

Still would like to know if this is possible though.

Userlevel 5
Badge +14

if it is just matter of some controls not being printed, I think you do not need duplicate repeating section at all.

you can assign controls the shouldn't be printed some custom class and define CSS style for the class tat will exclude controls from print outs.

see plenty of examples from google https://www.google.sk/search?q=noprint+css&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=L9LtWP7JB6nS8AfIk7mgBQ 

Badge +4

Hi, 

I have a similar requirement -- with a twist:

I have 2 repeating sections on same form -  RS1 set to visible/display only, no edit, no add new line;

RS2 - is used for adding new lines.

I need to append the added lines from RS2 to RS1; then clear RS2 for next update.

When the form is marked complete RS2 will be hidden - no more updates allowed.

I'm open to using a workflow or JavaScript.

(I'm looking at Paul Crawford's input from above)

Badge +1

Hi Paul,. 

I am trying to recreate your solution however i have an error that occurs. 

Could you possibly explain this further and list the field names?

Reply