Highlight changed "cells"

DAD
Bronze 1
Bronze 1

Hello,

Have my appsheet working pretty smooth, just one last tweak.

When a form executes changes to my source data, I need any changed cells to be highlighted in yellow. I thought there would be a way to use a format expression and when ever the action executes the changes I could set this here however it appears that is not the case? So i looked around and I found an App script for my sheet that works however only on the first change , then stops. so if there are 2 or more cell changes it will only highlights the first cell change.

Question is am I going in the right direction here or is there a way to execute actions and include the data format as well?

Here is the code I found: 

function onEdit() {

var sheetsToWatch = ['Source_Data', 'Local_Data'];

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var cell = sheet.getActiveCell();
var sheetName = sheet.getName();
var matchFound = false;

for (var i = 0; i < sheetsToWatch.length; i++) {
if (sheetName.match(sheetsToWatch[i])) matchFound = true;
  }
if (!matchFound) return;

var rowColLabel =
sheet.getRange(cell.getRow(),cell.getColumn()).setBackground('#faec15'); // #faec15
 // set backgorund color in yellow,
  // you can do any color

  }

Thanks,!

 

0 1 135
1 REPLY 1

One technique would be to add one or more columns that you can reference to know which other columns changed their value the last time the row was edited. That could be a single column whose value is a List type or an otherwise delimited Text type value, or it could be one column--perhaps a Change type--per each data column. Then, in the spreadsheet you could use conditional formatting formulas to style each data column according to whether the corresponding other column indicates that data column was changed.

Top Labels in this Space