Action

Draft content example

Posted by @sylumer, Last update over 2 years ago - Unlisted

Steps

  • includeAction

    name
    MGCheckListPrompt Library
  • script

    // Get most recently modified drafts in the Inbox.
    var drafts = Draft.query("", "inbox", [], [], 
    									"accessed", true, false)
    									.slice(0, 15);
    
    // Create an MGCheckListPrompt to choose some drafts.
    var prompt = new MGCheckListPrompt();
    prompt.message = "Pick one or more drafts:";
    prompt.addDrafts(drafts);
    
    // Show the prompt.
    var selectedItems = prompt.show();
    
    // Report the result.
    if (prompt.didShow) {
    	if (selectedItems != null) {
    		selectedItems.map(intIndex => 
    		alert(drafts[intIndex].content));
    		
    	} else {
    		app.displayInfoMessage("Prompt was cancelled.");
    	}
    } else {
    	app.displayErrorMessage("Something went wrong.");
    }

Options

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