How do I create an empty row?

While like many here, I do want to get rid of the empty rows in the spreadsheets, I also want to figure out how to add an empty row on the “front page”–to provide separation between sections.. At the moment, I am using a dash, “-”, to occupy the space. This “front page” is essentially a list of links. I tried   but that showed up literally.

If you could share more details such as what is this view type( table, detail etc.) , is this view just for navigation to other views and so a static view that will not have rows addition by the users, the community could help you with more appropriate suggestions.

2 Likes

To remove any gaps, I use the below Apps Script (scheduled daily to run main() when activity is low). (If you do search, you can probably find many more examples)

Just replace the elements in the fileList with your gsheet urls.

Please test it carefully before you use it in production.

const fileList = [
  'https://docs.google.com/spreadsheets/d/abcd...efg/edit',
  'https://docs.google.com/spreadsheets/d/hijk...lmn/edit'
]

function main() {
  fileList.forEach(cleanUp)
}

function cleanUp(fileUrl) {
  let gSheet;
  try {
    gSheet = SpreadsheetApp.openByUrl(fileUrl);
    gSheet.getSheets().forEach(closeGaps);
  } catch (e) {
    console.log(e);
  }
}

function closeGaps(sh) {
  const data = sh.getDataRange().getValues();
  for (let i = data.length -1; i > -1; i--) {
    (data[i][0] + '') === '' ? sh.deleteRow(i + 1) : undefined;
  }
}

As for adding an empty row, do columns of Show type work for you?

https://support.google.com/appsheet/answer/10106435?hl=en#show

1 Like

This view is a deck view–for navigation only. I followed an example/tutorial (which I can’t find right away) and created this page that uses actions to direct you to another view. I really like the ability to set up “pages” as a way of organizing information. It’d be perfect if I could make it look a bit more organized, so to speak.

Thank you. You could then possibly simply insert a row without any description in the deck view wherever you need to insert those empty spaces.? Maybe you have some additional requirement that you may want to elaborate.

Thank you! Didn’t know much about Show type view and just began to learn App Script, so appreciate both of these tips.

The way I set it up, empty rows don’t show up on the “page”, and " " doesn’t work either. But I suspect Show type view (that @TeeSee1 suggests below) might just work. Will also test out your idea of inserting a row without description. Thank you so much!

The below example shows an empty row with no description added to the table and the deck view reflects it. That empty row has only key column populated and the key column is anyway hidden.

2 Likes

That’s an easy fix! Thanks!

1 Like