Script to read Share Point content and place it in an email RRS feed

  • Question

  • I would like to automate the following: Access a specific item (entry) from a Share Point list and place the selected Share Point content into body of an email. 

    Could someone place let me know if there is a way to write a script, which would have parameters

          1. Share Point list address, and 

          2. index of the entry of the Share Point list, which needs to be read and placed in an email, 

    and which would accomplish the following steps:

    1. Access a specific item (entry) from a Share Point list;

    2. Select content from the entry;

    3. Open an email;

    4. Place the selected Share Point content into body of the email?

    The event would start with the addition of an item.

    I have been instructed to use workflow. I am a beginner in using SharePoint, and will take a tutorial to start with this idea.

    Sunday, March 12, 2017 8:03 PM

All replies

  • Hi

    you can use powershell to do it

    Add-PSSnapin Microsoft.SharePoint.PowerShell;
    $web= Get-SPWeb "http://your_site"
    $list= $web.Lists["your_list"]
    #$items= $list.GetItems()
    for-each ($item in $items)
       if($item['your_field'] -match 'needed-value')
          $value_to_send_by_mail = $item['your_field']

    Next, that $needed_value got to be send by email

    Please check my post how to send an email using powershell

    Regarding how to add an item

    $spListItem = $list.AddItem() 
    $spListItem[“Title”] = “your_title” 
    $spListItem[“TextField”] = “your_text” 

    Let me know if you need more details

    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Sunday, March 12, 2017 10:30 PM