1
0
-1

I have 2 level nested. each 1st and 2nd level have few test and few drop-downs. On page change when i put all the data field data.datafield1 = Util.jsonify(data.innerRepeat); this brings all values of a dropdown list. I need all the selected values only, for each inner and outer repeat. How can I achieve that? Pls help.

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi Bill.

      if I use Get repeated data array for individual fields, to prepare individual json of each outer or inner repeat will be time taken and complex. 

      Is there any way to get each individual outer/inner (complete fields in side an repeats) fields value(text field, selected drop-down, selected radio/check box)? This will be a great help

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi,

        You could use the Form.getRepeatData function on each of the fields you want to access.

        Easiest way is to right-click the field in a code editor and select Get repeated data array.

        1. umakanta dalai

          I think i am bad in presenting my requirement .

          looking at the above screenshot, Content is outer repeat, and Content1 is inner repeat. 

          1. how can i get selected data of Content and Content1
          2. i have a dds button in Content1(inner repeat) and i have to pass all selected values of each repeat of Content1 (in json format) while calling services. How can i do that?
        2. Bill Frost

          Hi,

          This code might be what you are after.  Use it in the button inside your repeat.  It will gather the sibling field values from all of the repeat instances the button appears in into the 'result' object array.  Use your own data field names instead of 'textField' and 'dropdown'.

          var result = []
          for (var i=0,len=data.$r.length; i<len; i++) {
              result.push({'textField': data.$r[i].textField, 'dropdown': data.$r[i].dropdown})
          }

          You will find more information about data.$r in All about repeating data

        CommentAdd your comment...