Data import rejection email

I am using Anaplan Connect to import the data in to the Module/Lists and would like to automate it with windows schedular. After the import there may be some rejections and is there a way I can get an email from Anaplan with rejection details / success message so that it will be easy to track the import status. Please suggest.

Tagged:

Answers

  • Hi Sudheer, here is what we have done in one of our implimentations
    1. Run the import actions by triggering .bat file
    2. Once done, call another powershell script which can send the email with error file as attachement.
    ===powershell script==
    $a="Anaplanadmin@test.com"
    [string[]]$b="toaddress@gmail.com"
    $c="Anaplan load - email alert"
    $d ="C:\Users\username\Desktop\Anaplan_Connect\AnaplanScripts"
    $e="C:\Users\username\Desktop\Anaplan_Connect\AnaplanScripts"
    # $e is the location of error file
    $SizeMax = 8 #MB
    # delete the files whose sizes are more than 8MB - bigger files can not be sent on email
    Get-ChildItem -Path $e -Recurse | Where { $_.Attributes -ne "Directory" -and $_.Length / 1MB -gt $SizeMax } | Remove-Item -Force
    Get-Childitem $e -include "*.err" -recurse -force -name| Where-Object {$_.Length -gt "0"}|foreach-object { $x++ }
    send-mailmessage -From "$a" -TO $b[0..10] -Subject "$c" -Body "$email_body"  -Attachments $FileNames[0..800]