title: Copy background color from one column to another with nodejs google sheets api
body: <p>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.</p>
  
  <p>I found this php doc that has get and set background:
  <a href="https://developers.google.com/resources/api-libraries/documentation/sheets/v4/php/latest/class-Google_Service_Sheets_CellFormat.html" rel="nofollow noreferrer">https://developers.google.com/resources/api-libraries/documentation/sheets/v4/php/latest/class-Google_Service_Sheets_CellFormat.html</a></p>
  
  <p>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?
  <a href="https://github.com/googleapis/google-api-nodejs-client/tree/master/samples/sheets" rel="nofollow noreferrer">https://github.com/googleapis/google-api-nodejs-client/tree/master/samples/sheets</a></p>
  
  <p>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?</p>
  
  <p>function getFormatting(sheetId, startRowIndex, endRowIndex, columns, column) {
    const function_name = 'getFormatting';</p>
  
  <pre><code>let { startColumnIndex, endColumnIndex } = getStartEndIndex(columns, column, column);
  
  const request =  [{
    "getBackgroundColor": {
            "backgroundColorRange": {
            "range": {
              sheetId,
              startRowIndex,
              endRowIndex,
              startColumnIndex,
              endColumnIndex,
            }, }
    }
  }];
  </code></pre>
  
  <p>}</p>
  
  <p>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</p>