Action

Add Item to Grocery

Posted by @nahumck, Last update 11 months ago - Unlisted

Adds an item to the list “Grocery” in Reminders, without creating a draft.

Steps

  • script

    //Grocery Add Script
    
    //Create Prompt
    var p = Prompt.create();
    p.title = "Add Item";
    p.message = "What do you need to get?";
    p.addTextField("fieldName", "Item", "", {placeholder:"eggs, milk, bread", wantsFocus:true});
    p.addButton("OK");
    p.show();
    
    var fieldContents = p.fieldValues["fieldName"];
    if (p.buttonPressed == "OK") {
      //add reminder to Groceries
      var list = ReminderList.findOrCreate("Grocery");
      var reminder = list.createReminder();
      reminder.title = fieldContents;
      reminder.update();
    }
    else {
      context.cancel();
    }

Options

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