Question: I have a script that creates additional files upon submission of a Google Form. It also sets up a trigger for said new document, so that people are emailed when any edits are made to the document after its creation, e.g.

```
ScriptApp.newTrigger("sendEmailOnModification")
         .forSpreadsheet(SpreadsheetApp.openById(fileId))
         .onEdit()
         .create();

```

The logic all works, but... the trigger is extremely sensitive. *Every* time someone makes a single keystroke in the document, it fires. It doesn't make a lot of sense to repeatedly fire as someone writes a paragraph; it makes more sense to, say, fire 10 minutes after the last edit. (Or something. Anything that doesn't spam emails.)

Is there a way to modify the trigger so that it fires less often (I do **not** want a time-based trigger), or otherwise programmatically change how frequently Google Sheets saves?

As a last resort, I suppose I could create a hidden sheet that captures last modified time and a condition not to send an email if subsequent modifications are less than X minutes ago, but that's kind of clunky and not really appealing. Hoping I can do it entirely in Google Scripts instead.

Answer: 
You will want to use calulated properties.

```
$Emails | Select-Object -Property @{Name='ID';Expression={$_.ID};},@{Name='AttachmentId';Expression={$_.Attachments.ID};}

```

You can shorten `Name` and `Expression` to `n` and `e`.

[See this article for more](https://mcpmag.com/articles/2017/01/19/using-powershell-calculated-properties.aspx).
you need to use a calculated property if you use `Select-Object`. something like this ... 

```
$Emails = @{     
            ID          = "E123"; 
            Subject     = "Check this out"; 
            Attachments = @{
                            ID   = "A123"; 
                            Name = "FunnyPic.jpg"
                           }
           }
$EmailsObject = New-Object -TypeName PSObject -Property $Emails

$EmailsObject |
    Select-Object ID,
        @{
        n = 'AttID'
        e = {$_.Attachments.ID}
        }

```

output ... 

```
ID   AttID
--   -----
E123 A123

```