I'm looking to loop through each row and based on a cell value I want to move another cell's value to new cell.
Example: Loop through each row if column "Method" has a value "D" move the cell value in column "Amount" (Column G) to "New Amount" (Column J).
What I have:
let row = 1;
let rowCount = table.getRowCount();
while (row <= rowCount) {
let text = table.getRange().getCell(row, columnToCheck).getText();
if (text === "D") {
selectedSheet.getRange(`J${row}`).setValue(selectedSheet.getRange(`G${row}`).getValue());
rowCount--;
} else {
row++;
}
}
