I am trying to copy the background color from one column that already has conditional formatting to another column so that both column cells have the same background color even though they have different data.
I found this php doc that has get and set background: https://developers.google.com/resources/api-libraries/documentation/sheets/v4/php/latest/class-Google_Service_Sheets_CellFormat.html
But can't find a ton of info on how to format this request with node. Not sure if get and set background exists in node? https://github.com/googleapis/google-api-nodejs-client/tree/master/samples/sheets
My plan was to get the background color from the formatted column and then copy that formatting into the column with no formatting. I can't really find any documentation on this for Node. Is there any? Is this even possible with a batchUpdate request?
function getFormatting(sheetId, startRowIndex, endRowIndex, columns, column) { const function_name = 'getFormatting';
let { startColumnIndex, endColumnIndex } = getStartEndIndex(columns, column, column);
const request = [{
"getBackgroundColor": {
"backgroundColorRange": {
"range": {
sheetId,
startRowIndex,
endRowIndex,
startColumnIndex,
endColumnIndex,
}, }
}
}];
}
I am hoping to get the background colors for say Column A1:A1(length) and copy those to B1:B1(length) in exactly the same order on the rows
length
ofColumn A1:A1(length)
andB1:B1(length)
? 3. Your question to know the script for copying the background color of cell "A1" to the cell "B1". Is my understanding correct? – Tanaike