Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Solved! Go to Solution.
If I understand well what you want to do, you should do something like:
var dynamicNameHere = "myCustomFieldName"; var newRow = {}; newRow[dynamicNameHere] = table.rows[0][dynamicNameHere]; AttTable.AddRow(newRow);
If I understand well what you want to do, you should do something like:
var dynamicNameHere = "myCustomFieldName"; var newRow = {}; newRow[dynamicNameHere] = table.rows[0][dynamicNameHere]; AttTable.AddRow(newRow);
Thank you for the response! How would it look if I was also adding values for known table headers in that same add row function? Would I just tack on to that string "newRow"?
New row it's a Javascript object not a String, and yes you can add as many fields as you want :
var newRow = { myField1: "myFieldValue1", myField2: 12.0 }; newRow[dynamicField1] = "dynamicFieldValue1"; newRow[dynamicField2] = "dynamicFieldValue2"; newRow["thirdDynamicField"] = 10.3;
This worked perfectly! Thank you!
Hello -
If this solution met your needs, could you please mark the question as solved?
Regards,
-Chris Kaminski