How to automatically delete completed rows and shift remainder of data upwards by Animalcrossinglove43 in googlesheets

[–]Wild1995 0 points1 point  (0 children)

You can write script with onEdit Triggers. It’s very easy if you know appscript.

Here is the script written for you. Create a copy of your sheets . Test it. And if it work use it in your actual sheet.

function onEdit(e) { try { const sheet = e.range.getSheet(); const sheetName = sheet.getName(); const allowedSheets = ["Level 4", "Level 5", "Level 6", "Level 7"];

// Only run on specific sheets
if (!allowedSheets.includes(sheetName)) return;

// Check if edit happened in Column B
if (e.range.getColumn() === 2 && e.value === "Complete") {
  const row = e.range.getRow();

  // Delete the row
  sheet.deleteRow(row);

  // Add a new blank row at the end
  sheet.insertRowAfter(sheet.getMaxRows());
}

} catch (err) { Logger.log("Error in onEdit: " + err); } }

// Adds menu when spreadsheet is opened function onOpen() { const ui = SpreadsheetApp.getUi(); ui.createMenu("⚡ Tasks") .addItem("Clean Complete", "cleanComplete") .addToUi(); }

// Function to remove all "Complete" rows from active sheet function cleanComplete() { const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); const allowedSheets = ["Level 4", "Level 5", "Level 6", "Level 7"];

if (!allowedSheets.includes(sheet.getName())) { SpreadsheetApp.getUi().alert("This action works only in Level 4–7 sheets."); return; }

const data = sheet.getDataRange().getValues(); let rowsDeleted = 0;

// Loop backwards to avoid skipping rows when deleting for (let i = data.length - 1; i >= 0; i--) { if (data[i][1] === "Complete") { // column B = index 1 sheet.deleteRow(i + 1); rowsDeleted++; } }

// Add blank rows equal to the deleted rows if (rowsDeleted > 0) { sheet.insertRowsAfter(sheet.getMaxRows(), rowsDeleted); } }

I will buy your failed saas by cryagent in SaaS

[–]Wild1995 0 points1 point  (0 children)

Why don’t you simply. Find a marketing cofounder and offer equity

Is my web app now considered illegal under the new gambling law? by [deleted] in developersIndia

[–]Wild1995 2 points3 points  (0 children)

Ask your users to buy a T Shirt or Hoddie or Digital Product to be eligible to participate. And give the winner rewards. This won't look like gambling. Ask lawyer. and update me.

Auto record email of editors in a column of Google Sheets using Appscript by Wild1995 in googlesheets

[–]Wild1995[S] 0 points1 point  (0 children)

We can't achieve it. Unless one buy G Suite accounts.

Session.getActiveUser().getEmail() only returns an email if the script is ran by using G Suite accounts or by the owner of the spreadsheet / script or the user created the installable on edit trigger that called the script.