Skip to main content
11-Garnet
August 26, 2022
Solved

pushing values to child infotable using for loop dynamically

  • August 26, 2022
  • 1 reply
  • 2227 views

SM_10230689_0-1661498511027.png

 

 

I want to push values to child infotables dynamically using nested for loop, in the above code the "infoname" parameter is the child infotable names which are dynamic. 

 

While executing the code i am not getting any issue, but the infotables are showing blank.

if i am passing the actual name instead of "infoname parameter" the values are showing in that particular infotable.

 

Is there any way to pass values to child infotables dynamically?

Best answer by nmutter

What @Sathishkumar_C  meant was:

 

for...{

   infoname = "Infotable"+k;

   for..

      ....

   }

   let newRow = {};

   newRow[infoname] = infotableTemp;

   parentinfotable.AddRow(newRow);

}

 

This may work but some points on this:

- dont forget to recreate the "infotableTemp" on each run (or it will just keep adding rows and rows)

- having a different name for each nested infotable does not make much sense

1 reply

17-Peridot
August 26, 2022

Try to add blank row first... than you can update dynamically.. 

 

parentinfotable.AddRow({});
parentinfotable.rows[parentinfotable.length - 1][infoname] = infotableTemp;

 

 

11-Garnet
August 26, 2022

Hi Sathish,

 

Have added blank first row as mentioned, but still the child infotables as coming null.

 

Thanks.

17-Peridot
August 26, 2022

try to share the code and sample data here..