How to copy values from multiple table rows into text field?

aka44356106

01-10-2019

Sir i have a new query

in a dynamic form add instance create multiple row by click a button

Table4._Row1.addInstance(0);

value of Table4.Row1(0).cell1.rawvalue, Table4.Row1(1).cell1.rawvalue, ............

can be copy in a textfield?

Accepted Solutions (1)

Accepted Solutions (1)

radzmar

MVP

06-10-2019

Well, the accessor names are all case-sensitive, so you may have to correct them.

Try:

  1. var oCells = Table4.resolveNodes("Row1.[Cell1 ne null]"), // Reference all instances of Row1, where Cell1 is not null 
  2.     cResult = "", // the output string 
  3.     i; // a count variable 
  4.  
  5. for (i = 0; i < oCells.length; i += 1) { 
  6.     cResult += oCells.item(i).Cell1.rawValue + " "; // Add rawValue of each filled cell to the output string. 
  7. this.rawValue = cResult;

Answers (4)

Answers (4)

aka44356106

09-10-2019

sir i want cResult in these formats

1. when instant manager count is 1

cResult outout is    Table4.Row1.cell1.rawvalue

2. when instant manager count is 2

cResult outout is    Table4.Row1[0].cell1.rawvalue + "and" +  Table4.Row1[1].cell1.rawvalue

3. when instant manager count is more than 2

cResult outout is    Table4.Row1[0].cell1.rawvalue + "," +  Table4.Row1[1].cell1.rawvalue + "and" + Table4.Row1[2].cell1.rawvalue

simply output will be  

instant manager count    = 1                             A

instant manager count    = 2                             A and B

instant manager count    = 3                            A, B, and C

instant manager count    = 4                            A, B, C and D

...........................

             

radzmar

MVP

01-10-2019

To collect the text values of multiple rows, use a for loop.

var oCells = Table4.resolveNodes("Row1.[cell1 ne null]"), // Reference all instances of Row1, where cell1 is not null

    cResult = "", // the output string

    i; // a count variable

for (i = 0; i < oCells.length; i += 1) {

    cResult += oCells.item(i).cell1.rawValue + " "; // Add rawValue of each filled cell to the output string.

}

this.rawValue = cResult;