Please help move a row of data from a form to another sheet based on cell value

59 views
Skip to first unread message

Jacob Landers

unread,
Sep 10, 2020, 6:18:20 PM9/10/20
to Google Apps Script Community
Okay I'm Really new to script editor and ive been working on this issue for awhile and cant figure it out, so if anyone could help me i would be grateful. I'm trying to have a row in a google sheet form automatically move to another tab on the same sheet. when the cell is changed to "Ready For Pickup" i want it to move from the "WhiteBoard" which is the form submission to the "Ready_For_Pickup" tab. 

Darren D'Mello

unread,
Sep 11, 2020, 3:34:09 AM9/11/20
to google-apps-sc...@googlegroups.com
Why not try this?

function onEdit(e) {
    var range = e.range;
    if ((range.getSheet().getName() == YOUR_SOURCE_SHEET_NAME) && (range.getColumn() == COLUMN_NUMBER)) {
        var r = range.getRow();
        var n = range.getNumRows();
        var ss = SpreadsheetApp.getActiveSpreadsheet();
        var sheet = ss.getSheetByName(DEFAULT_SHEET_NAME);

        if (range.getValue() == TRUE_VALUE) {
            if (sheet) {
                for (var z = r; z < (r + n); z++) {
                    var rows = sheet.getRange(z + ":" + z).getValues();

                    for (var i = 0; i < rows.length; i++) {
			NEWSHEETNAME_HANDLE.appendRow([rows[i]])
                    }
                }
            }
        }
    }
}

Darren D'Mello
miscellan...@gmail.com



On Fri, Sep 11, 2020 at 3:48 AM Jacob Landers <yacobl...@gmail.com> wrote:
Okay I'm Really new to script editor and ive been working on this issue for awhile and cant figure it out, so if anyone could help me i would be grateful. I'm trying to have a row in a google sheet form automatically move to another tab on the same sheet. when the cell is changed to "Ready For Pickup" i want it to move from the "WhiteBoard" which is the form submission to the "Ready_For_Pickup" tab. 

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/2dacc82f-d599-48b8-a539-849cf5600aaco%40googlegroups.com.


--
Best,
Darren
Reply all
Reply to author
Forward
0 new messages