Bike on sidewalk

Last update almost 6 years ago

This reads the name of a street or address from the input draft and asks which service the offending bike belongs to. It then generates an email to that bike company asking them to come pick up that bike.


  • script

    // Ask which service this is and map it to an email address
    var p = Prompt.create();
    p.title = "Which service?";
    var didSelect =;
    if (didSelect == false) {
    var emailAddress = serviceNameToEmail(p.buttonPressed);
    // Create the email
    var mail = Mail.create();
    mail.toRecipients = [emailAddress]
    mail.subject = "Bike parked on sidewalk"
    mail.body = "There is a bike parked on the sidewalk in Plano, TX on " + draft.content + ". Please come pick it up.";
    // Attempt to send the email
    var success = mail.send();
    if (!success) {
    /** Map bike service names to their reporting email addresses
     *	 @param serviceName The name of the service
     *	 @return The email address of the service
    function serviceNameToEmail(serviceName) {
    	switch(serviceName) {
    		case "LimeBike":
    			return "";
    		case "Ofo":
    			return "";
    		case "Vbikes":
    			return "";
    		case "test":
    			return ""
    			throw("Unknown bike service");


  • After Success Archive
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.