Automate

 View Only
  • 1.  Composer

    Posted 11-14-2019 12:41
    ​Hello,

    If you have a repeating table on your form and you pull in your data via query.  Is there a way to click on 'add new item' and the data that is in the first line of the queried data be duplicated to the second line as well?


    Thank you,
    Susan Raatz

    ------------------------------
    Susan Raatz | [Sr. Data Administrator]
    Pactiv LLC | 847-482-3231
    ------------------------------


  • 2.  RE: Composer

    Posted 11-15-2019 07:54
    Hi Susan,

    You'll have to use a bit of custom JavaScript, but it's a very easy statement. Essentially, you would need to add a custom button and on that button place the following:

    $form.addNewRow("[form table XPATH]");
    $form.setValue("[field xpath/my:Repeating_Content[1]/my:fieldName]", $form.getValue("[source field xpath]"));

    You call the $form.addNewRow once to get the new row. Then you need to use the $form.setValue for each field in the second row you set. The reason you need to use these commands is that you'll need to target the second row which is what Repeating_Content[1] does.

    This only works if you need to duplicate exactly one row and that row is the top row.

    ------------------------------
    Joshua Whitener | Technical Advisor
    Exxon Mobil Corporation | 8326258441
    ------------------------------



  • 3.  RE: Composer

    Posted 11-15-2019 11:27
    Thank you so much.  I will try this.​

    ------------------------------
    Susan Raatz | [Sr. Data Administrator]
    Pactiv LLC | 847-482-3231
    ------------------------------