Here is a script to clear the status columns on an edit or the use of an Edit URL.

203 views
Skip to first unread message

Joe Schmidt

unread,
Apr 8, 2019, 7:02:23 PM4/8/19
to nv-form-m...@googlegroups.com
I finally created a video to document a script to delete the status columns when a row is edited in the sheet or via an Edit URL. 

This script is for when you want to allow FormMule to run when there is a change to any data in the sheet.  

Thanks to Nolan Green for sharing the script.

Note: you will need to adjust the number of columns to be cleared.  For FormMule is it one per template.



The script will only clear the status information.  If the change is because of an Edit URL and there is a Form Trigger, then FormMule should start automatically.  

If the script is triggered by an edit inside the spreadsheet, the status columns will be cleared but FormMule will not run immediately.  


The script:


// Nolan Green shared this script with me. You need to change the columns and which sheet you
// want the script to use.  See below.
//
//THIS IS THE BEGINNING OF THE SCRIPT THAT CLEARS FIELDS WHEN A ROW IS EDITED.
function onEdit(e) {
  var currentSheet = e.range.getSheet();
  var sheetEdited = currentSheet.getName();
  var rowEdited = e.range.getRow();
  var columnEdited = e.range.getColumn();
  
  
  // column number where data should be cleared; A = 1, B = 2 etc
  // change the sheet name (sheetEdited) as appropriate. 
  if(sheetEdited == "Form Responses 1" && ( columnEdited < 5  || columnEdited > 8)){
    currentSheet.getRange(rowEdited,5).setValue('');
    currentSheet.getRange(rowEdited,6).setValue('');
    currentSheet.getRange(rowEdited,7).setValue('');
    currentSheet.getRange(rowEdited,8).setValue('');
  }
}
//THIS IS THE END OF THE SCRIPT THAT CLEARS THE AUTOCRAT FIELDS WHEN THE RESPONSES ARE EDITED

adi saputra

unread,
Dec 18, 2021, 11:24:00 PM12/18/21
to NV Form Mule Add-on
    • The video owner selected the setting to "Disable comments."
    • YouTube may have turned off comments on some videos for safety reasons, like to protect minors.

adi saputra

unread,
Dec 18, 2021, 11:24:10 PM12/18/21
to NV Form Mule Add-on

  • The video owner selected the setting to "Disable comments."
  • YouTube may have turned off comments on some videos for safety reasons, like to protect minors.

Joseph Schmidt

unread,
Dec 19, 2021, 12:20:29 PM12/19/21
to nv-form-m...@googlegroups.com
I created that video.  YouTube must have turned off comments.  You can send me a question via this conference or a personal email.



--
You received this message because you are subscribed to the Google Groups "NV Form Mule Add-on" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nv-form-mule-ad...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nv-form-mule-add-on/ca196db7-3841-4e29-8f70-103481a33bd8n%40googlegroups.com.

Jamie Beedy

unread,
Jan 2, 2023, 11:32:43 AM1/2/23
to NV Form Mule Add-on
Very new to scripting and am wondering can this script be modified to clear the values on another sheet? I have my Form Response 1 Tab and a Invoice Tab. The invoice tab is the sheet that Autocrat is using. If changes made to the Form Submission, I need to clear the Autocrat Values on the Invoice tab.  

Any help or guidance would be appreciated. 

Thanks
Jamie

Joseph Schmidt

unread,
Jan 2, 2023, 12:08:59 PM1/2/23
to nv-form-m...@googlegroups.com
If the invoice has the same rows as the FormResponse sheet, why not run the invoice on the Response sheet?

If you read the comments, you will see that I only know enough about scripting to modify the work of others with a twist or two being added.

Joe Schmidt
Reply all
Reply to author
Forward
0 new messages