cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Can you duplicate a repeating section in the same form?

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?

0 Kudos
Reply
15 Replies
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

‌ were you able to solve this in the end?

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

Unfortunately no I haven't

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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...

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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 ...

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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.

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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.

Accept as Solution Reply
Workflow Hero

Re: Can you duplicate a repeating section in the same form?

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

Accept as Solution Reply