Populate Table in Adaptive form from JSON result

sureshp23286254

14-04-2020

Hi,

I'm trying to populate  table in Adaptive Form  from json result and i have set the Table Row1 as repeatable by setting Min count as 1 and max count as -1.

On change of text field value I'm invoking service and getting the json result. Now I need to iterate the for loop and populate the table. I'm able to assign to the first row by  panel1585577468838.table1585577511230.Row1.TicketNo.value = row.u_ticket_no;

In the loop I'm creating new rows using addInstance() and they are getting created.

panel1585577468838.table1585577511230.Row1.instanceManager.addInstance();

 

But I'm not able to figure out how to assign to fields from 2nd row. How do i access 2nd row. 

I tried below options and didn't work. 

panel1585577468838.table1585577511230.Row1[0].TicketNo.value = row.u_ticket_no;

or 

panel1585577468838.table1585577511230.Row2.TicketNo.value = row.u_ticket_no;

or

panel1585577468838.table1585577511230.resolveNode("Row1["+i+"]").TicketNo.value = row.u_ticket_no;

 

Please let me know if you need any additional details. 

 

 

Thanks & Regards

   Suresh

 

@Mayank_Gandhi

 

Accepted Solutions (1)

Accepted Solutions (1)

Mayank_Gandhi

Employee

14-04-2020

@sureshp23286254 Try using som expression. Here is a sample js 

 

 

var ss=
{"pop":[
{
"country": "Afghanistan",
"population": "35530081"
},
{
"country": "Albania",
"population": "2930187"
},
{
"country": "Algeria",
"population": "41318142"
},
{
"country": "American Samoa",
"population": "55641"
},
{
"country": "Andorra",
"population": "76965"
},
{
"country": "Angola",
"population": "29784193"
}]};

Row1.instanceManager.addInstance();
var a="table1586874906868[0].Row1["+i+"].tableItem11[0]";
guideBridge.resolveNode(a).value=ss.pop[i].country;
console.log(ss.pop[i].country);
window.i++;

Answers (4)

Answers (4)

Mayank_Gandhi

Employee

14-04-2020