Table: Populate Subsequent Cells in Column

When you have a column where the entered data in the first cell is the same data for the rest, you can create a button that will populate the rest of the cells in the column with the data from the first cell. 

Example:  

The code below is taking the data in the first cell of the Home Phone column and filling the rest of the cells in the column with the same phone number.

if(Button.clicked){
  
  //if the first cell in the phone column is not empty 
  if(Phone[0].value !==null){
   
    for (var i = 1; i < Name.value.length; i++ ) {
      
     //fill all subsequent cells in phone column with data from first cell.
      Phone[i].value = Phone[0].value;
      
    }

  // else if first cell is empty
  } else {

    //don't fill subsequent columns
    Phone[i].value = null;
    
  }
}

 

Details

Article ID: 51457
Created
Tue 4/3/18 4:24 PM
Modified
Thu 4/12/18 11:32 AM