SlideShare a Scribd company logo
#TargetXSummit
Automated Data Loading /w
Little to No Duplicates!
Jen Perlee
#TargetXSummit
Agenda
Things I’m going to talk about
● Introduction
● Our Problem
● Our Thought Process
● Our Solution
● Demo
● What We Still Need to Figure Out
● Q&A
#TargetXSummit
Hello!!
● I am Jen Perlee
● Certified Advanced Salesforce Administrator (just passed my exam last month)
● Champlain College (more about that on the next slide)
● 24 years in IT @ Champlain
● 3 years as a Salesforce Admin
A Little About Champlain College
● Founded in 1878, Champlain College® is a small, not-for-profit, private college
overlooking Lake Champlain and Burlington, Vermont, with additional
campuses in Montreal, Canada, and Dublin, Ireland.
● 29 Traditional on-campus Undergraduate Degrees
● 66 100% Online Certificate Programs, Associates, Bachelors and Masters
Degrees.
Our Salesforce Target -X Story
● Started out with our own custom Salesforce Implementation
● Quickly out grew our resources
● Have been live on Target-X since April 2017
● Started w/ our online division
● Traditional Undergrad went live w/ Inquiry in January
● Go Live w/ Applicants 8/1 (using Target-X, CommonApp & Fire Engine Red)
● Online Retention will soft-lauch on Thursday
#TargetXSummit
Our Problem
● Receive List from ~10 different sources (SAT, ACT, Raiseme, Royall etc)
● This doesn’t even include web inquires, phone call, e-mails
● We knew we were going to import duplicates lots of duplicates
● Duplicates are more than annoying
● They cost money (data storage, e-mail usage, manpower)
● Lead to inaccurate reporting
● Poor customer experience
● They are a time suck
#TargetXSummit
Thought Process
● Dupe clean-up: Allow duplicates to be created and clean-up after
● VS.
● Dupe Prevention: Append data to existing records so duplicate is never created
● We wanted to avoid as many duplicates BEFORE they came into Target-X
● Nothing will ever 100% stop duplicates but we wanted to strive for as close to 100%
● Brainstormed ideas
● Looked into buying tools
● Needed to be mostly automated
● Needed to include solutions for all data entry points
#TargetXSummit
Solution
● Tools we ended up using:
● Demand tools Find/Report IDs
● Demand tools Job Builder
● Basic Powershell and Batch scripts
● Informatica
● Special shout-out to the Target-X Forums and Especially Fiona Kelly from St. Martin University
for getting me started using tools we already have.
● Why?
● ‘Free’
● Low Overhead
● Relatively easy to implement
#TargetXSummit
High-Level Steps
● Get data to our Informatica server (secure FTP and Encrypt the files)
● Use JobBuilder to automate…..
● Run a script that checks the header against a known good header and send an e-mail if they
do not match
● Use D/T Find/Report IDs to find contacts base on a tiered approach
● Use the result of that file to import data with the found IDs using Informatica Uniquie IDs
● Run a Script that e-mails if there are multiple matches found
● Fix any multiple matches and re-import
#TargetXSummit
Demo
● DemandTools FindIDs
● JobBuilder
● Scripts
#TargetXSummit
Resources
● DemandTools Help Console –
● http://www.helpconsole.com/demandtools
● DemandTools Find/Report ID’s Help -
http://www.helpconsole.com/DemandTools/default.aspx#pageid=find_report_ids
● JobBuilder Help Console
● http://www.helpconsole.com/DemandToolsJobBuilder/
● JobBuilder Scenario Syntax
● http://www.helpconsole.com/DemandToolsJobBuilder/#pageid=demandtools_job___sce
nario_syntax
#TargetXSummit
Still to figure out/improve
● Duplicates in the same file
● Better way to automate/fix current duplicates
● Validty – What does this mean
Any Questions?
#TargetXSummit
Thank You
Jen Perlee
Perlee@Champlain.Edu
#Powershell Script to compare header rows
if(Compare-Object -ReferenceObject $(Get-Content "PATH TO CSV TO CHECK" -totalCount 1) -
DifferenceObject $(Get-Content "PATH TO KNOWN GOOD HEADER ROW"))
{$From = "FROM ADDRESS"
$To = "SEND TO EMAIL ADDRESS"
$Subject = "EMAIL SUBJECT"
$Body = "BOSY OF EMAIL"
$SMTPServer = "SMTP SERVER ADDRESS"
Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer
$filename = "Cappex_"
$datetime = date -format MM-dd-yy-hh-mm-ss
Rename-Item -Path "ORIGINAL PATH and FILENAME SHOULD BE SAME AS ABOVE" -NewName ($filename
+ $datetime + ".csv") }
# Powershell Script to Look for multiple matches in csv's saved to a specific directory #
# BEG CONFIG #
$root_folder = "PATH OF THE FILES YOU ARE CHECKING"
$email = "EMAIL TO SEND TO - SEPERATE BY A COMMA"
#Select field of CSV to evaluate
$search_field = "CRMfusionField_UniqueMatchCount"
#Set search threshold, logic used is ge (greater than or equal to)
$search_threshold = 2
# END CONFIG #
#Logging function
function logit ($code, $message)
{
#Change these values to match what you want, this function assumes it will log
#to the directory the script originated from with a file called logit.txt
#If you put this function in "test.ps1" for instance and called it with these examples
#you would get indicated results.
#Example call: logit 1 "hello"
#Example Result: Date/Time - test.ps1 - ERROR - hello
#Example call: logit 0 "test"
#Example Result: Date/Time - test.ps1 - INFO - test
#Example call: logit 2 "warning test"
#Example Result: Date/Time - test.ps1 - WARN - warning test
#Code Mappings
#By default, 0 is info, 1 is error and 2 is warn when using logit. Add more to the array if needed.
#Array starts at 0, so don't change first 3, if you add a fourth element it will be
#code number 3, 5th would be 4, etc.
$codeArray = @("INFO","ERROR","WARN","ERROR","UPDATE","DEBUG")
$messagetype = $codeArray[$code]
#Determine what this script is called and the path.
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
#$scriptpath = Split-Path $Invocation.MyCommand.Definition
#Two options for scriptname, if you want full path and extension use the second one.
#If you just want the script name without path or extension when logging use the first.
#For best operation make sure one of these lines is commented out.
$scriptname = $MyInvocation.Scriptname.Split('') | Select-Object -Last 1
#$scriptname = $MyInvocation.ScriptName
#Determine date and time
$date = Get-Date
#Create Logfile if it doesn't exist and open for appending always.
#If you want the logfile somwhere else simply replace the path/filename below.
<#
If(Test-Path $logfile)
{
#Logfile exists, continue.
}
Else
{
#Logfile doesn't exist, create it and continue.
new-item $logfile -type file
}
#>
$logstring = "$date - $scriptname - $messagetype - $message"
Write-Host $null
if( $code -eq "1" )
{
Write-Host "$logstring" -ForeGroundColor Red
}
if( $code -eq "2" )
{
Write-Host "$logstring" -ForegroundColor Yellow
}
if( $code -eq "0" )
{
Write-Host "$logstring"
}
if( $code -eq "3" )
{
#Adding this for errors that don't require intervention and should just be revewied in the logs.
Write-Host "$logstring" -ForeGroundColor Red
}
if( $code -eq "4" )
{
#Adding this so that AD changes show up green visually as script is run
Write-Host "$logstring" -ForeGroundColor Green
}
if ($code -eq "5" )
{
Write-Host "$logstring" -ForegroundColor Cyan
if ($debugPausing -eq "1")
{
pause
}
}
Write-Host $null
Add-Content $logfile "$logstring"
if ( $code -eq "1" )
{
pause
}
}
function sendEmail ($ef_to, $ef_from, $ef_subject, $ef_body, $ef_attachment)
{
#Function to send email
#Configure custom header values if you wish
#CONFIG
$custom_headers = "yes"
$smtpServer = "SMTP SERVER NAME"
$msg = new-object Net.Mail.MailMessage
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
$msg.From = "$ef_from"
$msg.ReplyTo = "$ef_from"
$msg.To.Add($ef_to)
$msg.subject = "$ef_subject"
$msg.body = $ef_body
$msg.IsBodyHtml = $true
if ($custom_headers = "yes")
{
#Example:
#$msg.Headers.Add("CCAccntCreate", 1)
#You can add more than one in sequence
$msg.Headers.Add("CCAccntCreate", 1)
}
$msg.IsBodyHtml = $true
$msg.Body = "$ef_body"
#Add the attachment if it is there
if($ef_attachment -ne $null)
{
$msg.Attachments.Add($ef_attachment)
}
$smtp.Send($msg)
}
function successCheck()
{
#Reports success of the operation before the one that calls it.
if($?)
{
logit 0 "Operation was Successful!"
}
else
{
logit 1 "Operation Failed!"
$error_text = $error[0]
logit 2 "Error Received by SuccessCheck: $error_text"
}
}
#Set up logging file
$logs_folder = "$root_folderlogs"
if (!(Test-Path $logs_folder)) {New-Item -ItemType Directory $logs_folder}
$logstamp = date -format MM-dd-yy-hh-mm-ss
$logfile = "$logs_folderrecord_check_log-$logstamp.txt"
logit 0 "Script running..."
$csv_files = Get-ChildItem -Path "$root_folder" -Filter "*.csv"
foreach ($file in $csv_files)
{
$file_fullname = $file.FullName
$file_basename = $file.BaseName
$file_processed_name = "$root_folderprocessed$file_basename-processed-$logstamp.csv"
logit 0 "Processing file: $file_fullname"
$csv_data = Import-CSV $file_fullname
$count = 0
$new_csv_file = "$root_folderoutput$file_basename-filtered-$logstamp.csv"
foreach ($line in $csv_data)
{
$search_value = $line.$search_field
if ($search_value -ge $search_threshold)
{
#Write the line to a new CSV file
logit 0 "Found matching line, adding to $new_csv_file"
$count++
logit 0 "Match count for file: $file_fullname is now $count"
$line | Export-CSV $new_csv_file -Append -NoTypeInformation
}
}
if (Test-Path $new_csv_file)
{
#Send email to notify that file was made
logit 0 "Sending email notification..."
sendEmail $email "FROM ADDRESS" "Informatica Duplicate Records Found" "Record check found
<b>$count</b> lines where <b>$search_field</b> was greater than or equal to $search_threshold in
original file: <b>$file_fullname</b><br><br>Matching lines saved to new file: <b>$new_csv_file</b>"
}
logit 0 "Finished with file: $file_fullname"
#Move CSV file to processed directory when done with it.
logit 0 "Moving original file from $file_fullname to $file_processed_name"
Move-Item $file_fullname $file_processed_name
}

More Related Content

What's hot

Being a better programmer: Writing Clean COBOL
Being a better programmer: Writing Clean COBOLBeing a better programmer: Writing Clean COBOL
Being a better programmer: Writing Clean COBOL
Mike Harris
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
Wellfire Interactive
 
Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3
Mohd Harris Ahmad Jaal
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
Dave Cross
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
Vineet Kumar Saini
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Muhamad Al Imran
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Muhamad Al Imran
 
php 2 Function creating, calling, PHP built-in function
php 2 Function creating, calling,PHP built-in functionphp 2 Function creating, calling,PHP built-in function
php 2 Function creating, calling, PHP built-in function
tumetr1
 
DBIx::Class introduction - 2010
DBIx::Class introduction - 2010DBIx::Class introduction - 2010
DBIx::Class introduction - 2010
leo lapworth
 
Advancing Your Custom Fields - WordCamp 2014
Advancing Your Custom Fields - WordCamp 2014Advancing Your Custom Fields - WordCamp 2014
Advancing Your Custom Fields - WordCamp 2014
Carleton Web Services
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
Muthuselvam RS
 
Power Theming
Power ThemingPower Theming
Power Themingdrkdn
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
Programming Homework Help
 
PHP - Introduction to PHP Functions
PHP -  Introduction to PHP FunctionsPHP -  Introduction to PHP Functions
PHP - Introduction to PHP Functions
Vibrant Technologies & Computers
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
Ahmed Swilam
 
Php
PhpPhp
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
Ahmed Swilam
 

What's hot (20)

Further Php
Further PhpFurther Php
Further Php
 
Being a better programmer: Writing Clean COBOL
Being a better programmer: Writing Clean COBOLBeing a better programmer: Writing Clean COBOL
Being a better programmer: Writing Clean COBOL
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
 
Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3Web Application Development using PHP Chapter 3
Web Application Development using PHP Chapter 3
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php Tutorials for Beginners
Php Tutorials for BeginnersPhp Tutorials for Beginners
Php Tutorials for Beginners
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
php 2 Function creating, calling, PHP built-in function
php 2 Function creating, calling,PHP built-in functionphp 2 Function creating, calling,PHP built-in function
php 2 Function creating, calling, PHP built-in function
 
DBIx::Class introduction - 2010
DBIx::Class introduction - 2010DBIx::Class introduction - 2010
DBIx::Class introduction - 2010
 
Advancing Your Custom Fields - WordCamp 2014
Advancing Your Custom Fields - WordCamp 2014Advancing Your Custom Fields - WordCamp 2014
Advancing Your Custom Fields - WordCamp 2014
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
Power Theming
Power ThemingPower Theming
Power Theming
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
 
PHP - Introduction to PHP Functions
PHP -  Introduction to PHP FunctionsPHP -  Introduction to PHP Functions
PHP - Introduction to PHP Functions
 
Class 3 - PHP Functions
Class 3 - PHP FunctionsClass 3 - PHP Functions
Class 3 - PHP Functions
 
05php
05php05php
05php
 
Php
PhpPhp
Php
 
Class 2 - Introduction to PHP
Class 2 - Introduction to PHPClass 2 - Introduction to PHP
Class 2 - Introduction to PHP
 

Similar to 4.7 Automate Loading Data with Little to No Duplicates!

03-forms.ppt.pptx
03-forms.ppt.pptx03-forms.ppt.pptx
03-forms.ppt.pptx
Thắng It
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
Dave Cross
 
Php Security3895
Php Security3895Php Security3895
Php Security3895Aung Khant
 
php part 2
php part 2php part 2
php part 2
Shagufta shaheen
 
PHP Security
PHP SecurityPHP Security
PHP Security
manugoel2003
 
Php, mysq lpart1
Php, mysq lpart1Php, mysq lpart1
Php, mysq lpart1
Subhasis Nayak
 
Qpsmtpd
QpsmtpdQpsmtpd
Qpsmtpd
Fred Moyer
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
O'Reilly Media
 
Quick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPQuick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHP
Sanju Sony Kurian
 
Lecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptxLecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptx
ShaimaaMohamedGalal
 
10 Email Etc
10 Email Etc10 Email Etc
10 Email Etc
Geshan Manandhar
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::ManagerJay Shirley
 
Modern Perl
Modern PerlModern Perl
Modern Perl
Dave Cross
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
Programming Homework Help
 
Perl Teach-In (part 2)
Perl Teach-In (part 2)Perl Teach-In (part 2)
Perl Teach-In (part 2)
Dave Cross
 
Learn php with PSK
Learn php with PSKLearn php with PSK
Learn php with PSK
Prabhjot Singh Kainth
 

Similar to 4.7 Automate Loading Data with Little to No Duplicates! (20)

03-forms.ppt.pptx
03-forms.ppt.pptx03-forms.ppt.pptx
03-forms.ppt.pptx
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Php Security3895
Php Security3895Php Security3895
Php Security3895
 
php part 2
php part 2php part 2
php part 2
 
PHP Security
PHP SecurityPHP Security
PHP Security
 
Php security3895
Php security3895Php security3895
Php security3895
 
Php, mysq lpart1
Php, mysq lpart1Php, mysq lpart1
Php, mysq lpart1
 
Qpsmtpd
QpsmtpdQpsmtpd
Qpsmtpd
 
Dealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter ScottDealing with Legacy Perl Code - Peter Scott
Dealing with Legacy Perl Code - Peter Scott
 
lab4_php
lab4_phplab4_php
lab4_php
 
lab4_php
lab4_phplab4_php
lab4_php
 
Quick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPQuick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHP
 
Lecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptxLecture9_OOPHP_SPring2023.pptx
Lecture9_OOPHP_SPring2023.pptx
 
10 Email Etc
10 Email Etc10 Email Etc
10 Email Etc
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::Manager
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
 
Perl Teach-In (part 2)
Perl Teach-In (part 2)Perl Teach-In (part 2)
Perl Teach-In (part 2)
 
Learn php with PSK
Learn php with PSKLearn php with PSK
Learn php with PSK
 

More from TargetX

Lessons in Designing a Mobile Experience
Lessons in Designing a Mobile ExperienceLessons in Designing a Mobile Experience
Lessons in Designing a Mobile Experience
TargetX
 
Redesigning the Student Experience
Redesigning the Student ExperienceRedesigning the Student Experience
Redesigning the Student Experience
TargetX
 
Lessons in Designing a Mobile Experience
Lessons in Designing a Mobile ExperienceLessons in Designing a Mobile Experience
Lessons in Designing a Mobile Experience
TargetX
 
The Role of the Lifecycle CRM in Your Retention Strategy
The Role of the Lifecycle CRM in Your Retention StrategyThe Role of the Lifecycle CRM in Your Retention Strategy
The Role of the Lifecycle CRM in Your Retention Strategy
TargetX
 
CRM 101 - 401: Building Best Practices Into Your Roadmap
CRM 101 - 401: Building Best Practices Into Your RoadmapCRM 101 - 401: Building Best Practices Into Your Roadmap
CRM 101 - 401: Building Best Practices Into Your Roadmap
TargetX
 
Using Your Data to Enhance Recruitment
Using Your Data to Enhance RecruitmentUsing Your Data to Enhance Recruitment
Using Your Data to Enhance Recruitment
TargetX
 
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
TargetX
 
TargetX Insights: MultiObject Dashboards
TargetX Insights: MultiObject DashboardsTargetX Insights: MultiObject Dashboards
TargetX Insights: MultiObject Dashboards
TargetX
 
Make Your Application Community Feel More Like Home
Make Your Application Community Feel More Like HomeMake Your Application Community Feel More Like Home
Make Your Application Community Feel More Like Home
TargetX
 
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
TargetX
 
Automatic Document Indexing to Your SIS
Automatic Document Indexing to Your SISAutomatic Document Indexing to Your SIS
Automatic Document Indexing to Your SIS
TargetX
 
A Customized Approach to Confirm Your Enrollment
A Customized Approach to Confirm Your EnrollmentA Customized Approach to Confirm Your Enrollment
A Customized Approach to Confirm Your Enrollment
TargetX
 
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
TargetX
 
TargetX Retention: Now and the Future
TargetX Retention: Now and the FutureTargetX Retention: Now and the Future
TargetX Retention: Now and the Future
TargetX
 
Student Journeys: Best Practices for the TargetX Platform
Student Journeys: Best Practices for the TargetX PlatformStudent Journeys: Best Practices for the TargetX Platform
Student Journeys: Best Practices for the TargetX Platform
TargetX
 
Retention War Stories and Best Practices
Retention War Stories and Best PracticesRetention War Stories and Best Practices
Retention War Stories and Best Practices
TargetX
 
How To Create an Engaging and Welcoming Community Through Schools App
How To Create an Engaging and Welcoming Community Through Schools AppHow To Create an Engaging and Welcoming Community Through Schools App
How To Create an Engaging and Welcoming Community Through Schools App
TargetX
 
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
TargetX
 
Simple Survey = Visit Victory
Simple Survey = Visit VictorySimple Survey = Visit Victory
Simple Survey = Visit Victory
TargetX
 
Schools App Best Practices
Schools App Best PracticesSchools App Best Practices
Schools App Best Practices
TargetX
 

More from TargetX (20)

Lessons in Designing a Mobile Experience
Lessons in Designing a Mobile ExperienceLessons in Designing a Mobile Experience
Lessons in Designing a Mobile Experience
 
Redesigning the Student Experience
Redesigning the Student ExperienceRedesigning the Student Experience
Redesigning the Student Experience
 
Lessons in Designing a Mobile Experience
Lessons in Designing a Mobile ExperienceLessons in Designing a Mobile Experience
Lessons in Designing a Mobile Experience
 
The Role of the Lifecycle CRM in Your Retention Strategy
The Role of the Lifecycle CRM in Your Retention StrategyThe Role of the Lifecycle CRM in Your Retention Strategy
The Role of the Lifecycle CRM in Your Retention Strategy
 
CRM 101 - 401: Building Best Practices Into Your Roadmap
CRM 101 - 401: Building Best Practices Into Your RoadmapCRM 101 - 401: Building Best Practices Into Your Roadmap
CRM 101 - 401: Building Best Practices Into Your Roadmap
 
Using Your Data to Enhance Recruitment
Using Your Data to Enhance RecruitmentUsing Your Data to Enhance Recruitment
Using Your Data to Enhance Recruitment
 
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
The Power of Science + Art: How Advanced Analytics Innovations and Staff Empo...
 
TargetX Insights: MultiObject Dashboards
TargetX Insights: MultiObject DashboardsTargetX Insights: MultiObject Dashboards
TargetX Insights: MultiObject Dashboards
 
Make Your Application Community Feel More Like Home
Make Your Application Community Feel More Like HomeMake Your Application Community Feel More Like Home
Make Your Application Community Feel More Like Home
 
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
From Front-line to Home Office: Using Your CRM to Manage One Stop Student Ser...
 
Automatic Document Indexing to Your SIS
Automatic Document Indexing to Your SISAutomatic Document Indexing to Your SIS
Automatic Document Indexing to Your SIS
 
A Customized Approach to Confirm Your Enrollment
A Customized Approach to Confirm Your EnrollmentA Customized Approach to Confirm Your Enrollment
A Customized Approach to Confirm Your Enrollment
 
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
Tracking Your Traffic: Using TargetX Engage to Collect, Manage, and Predict W...
 
TargetX Retention: Now and the Future
TargetX Retention: Now and the FutureTargetX Retention: Now and the Future
TargetX Retention: Now and the Future
 
Student Journeys: Best Practices for the TargetX Platform
Student Journeys: Best Practices for the TargetX PlatformStudent Journeys: Best Practices for the TargetX Platform
Student Journeys: Best Practices for the TargetX Platform
 
Retention War Stories and Best Practices
Retention War Stories and Best PracticesRetention War Stories and Best Practices
Retention War Stories and Best Practices
 
How To Create an Engaging and Welcoming Community Through Schools App
How To Create an Engaging and Welcoming Community Through Schools AppHow To Create an Engaging and Welcoming Community Through Schools App
How To Create an Engaging and Welcoming Community Through Schools App
 
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
TargetX and Telemarketing: Utilizing the Telemarketing Tool to Support Recrui...
 
Simple Survey = Visit Victory
Simple Survey = Visit VictorySimple Survey = Visit Victory
Simple Survey = Visit Victory
 
Schools App Best Practices
Schools App Best PracticesSchools App Best Practices
Schools App Best Practices
 

Recently uploaded

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 

4.7 Automate Loading Data with Little to No Duplicates!

  • 1. #TargetXSummit Automated Data Loading /w Little to No Duplicates! Jen Perlee
  • 2. #TargetXSummit Agenda Things I’m going to talk about ● Introduction ● Our Problem ● Our Thought Process ● Our Solution ● Demo ● What We Still Need to Figure Out ● Q&A
  • 3. #TargetXSummit Hello!! ● I am Jen Perlee ● Certified Advanced Salesforce Administrator (just passed my exam last month) ● Champlain College (more about that on the next slide) ● 24 years in IT @ Champlain ● 3 years as a Salesforce Admin
  • 4. A Little About Champlain College ● Founded in 1878, Champlain College® is a small, not-for-profit, private college overlooking Lake Champlain and Burlington, Vermont, with additional campuses in Montreal, Canada, and Dublin, Ireland. ● 29 Traditional on-campus Undergraduate Degrees ● 66 100% Online Certificate Programs, Associates, Bachelors and Masters Degrees.
  • 5. Our Salesforce Target -X Story ● Started out with our own custom Salesforce Implementation ● Quickly out grew our resources ● Have been live on Target-X since April 2017 ● Started w/ our online division ● Traditional Undergrad went live w/ Inquiry in January ● Go Live w/ Applicants 8/1 (using Target-X, CommonApp & Fire Engine Red) ● Online Retention will soft-lauch on Thursday
  • 6. #TargetXSummit Our Problem ● Receive List from ~10 different sources (SAT, ACT, Raiseme, Royall etc) ● This doesn’t even include web inquires, phone call, e-mails ● We knew we were going to import duplicates lots of duplicates ● Duplicates are more than annoying ● They cost money (data storage, e-mail usage, manpower) ● Lead to inaccurate reporting ● Poor customer experience ● They are a time suck
  • 7. #TargetXSummit Thought Process ● Dupe clean-up: Allow duplicates to be created and clean-up after ● VS. ● Dupe Prevention: Append data to existing records so duplicate is never created ● We wanted to avoid as many duplicates BEFORE they came into Target-X ● Nothing will ever 100% stop duplicates but we wanted to strive for as close to 100% ● Brainstormed ideas ● Looked into buying tools ● Needed to be mostly automated ● Needed to include solutions for all data entry points
  • 8. #TargetXSummit Solution ● Tools we ended up using: ● Demand tools Find/Report IDs ● Demand tools Job Builder ● Basic Powershell and Batch scripts ● Informatica ● Special shout-out to the Target-X Forums and Especially Fiona Kelly from St. Martin University for getting me started using tools we already have. ● Why? ● ‘Free’ ● Low Overhead ● Relatively easy to implement
  • 9. #TargetXSummit High-Level Steps ● Get data to our Informatica server (secure FTP and Encrypt the files) ● Use JobBuilder to automate….. ● Run a script that checks the header against a known good header and send an e-mail if they do not match ● Use D/T Find/Report IDs to find contacts base on a tiered approach ● Use the result of that file to import data with the found IDs using Informatica Uniquie IDs ● Run a Script that e-mails if there are multiple matches found ● Fix any multiple matches and re-import
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. #TargetXSummit Resources ● DemandTools Help Console – ● http://www.helpconsole.com/demandtools ● DemandTools Find/Report ID’s Help - http://www.helpconsole.com/DemandTools/default.aspx#pageid=find_report_ids ● JobBuilder Help Console ● http://www.helpconsole.com/DemandToolsJobBuilder/ ● JobBuilder Scenario Syntax ● http://www.helpconsole.com/DemandToolsJobBuilder/#pageid=demandtools_job___sce nario_syntax
  • 17. #TargetXSummit Still to figure out/improve ● Duplicates in the same file ● Better way to automate/fix current duplicates ● Validty – What does this mean
  • 20. #Powershell Script to compare header rows if(Compare-Object -ReferenceObject $(Get-Content "PATH TO CSV TO CHECK" -totalCount 1) - DifferenceObject $(Get-Content "PATH TO KNOWN GOOD HEADER ROW")) {$From = "FROM ADDRESS" $To = "SEND TO EMAIL ADDRESS" $Subject = "EMAIL SUBJECT" $Body = "BOSY OF EMAIL" $SMTPServer = "SMTP SERVER ADDRESS" Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer $filename = "Cappex_" $datetime = date -format MM-dd-yy-hh-mm-ss Rename-Item -Path "ORIGINAL PATH and FILENAME SHOULD BE SAME AS ABOVE" -NewName ($filename + $datetime + ".csv") }
  • 21. # Powershell Script to Look for multiple matches in csv's saved to a specific directory # # BEG CONFIG # $root_folder = "PATH OF THE FILES YOU ARE CHECKING" $email = "EMAIL TO SEND TO - SEPERATE BY A COMMA" #Select field of CSV to evaluate $search_field = "CRMfusionField_UniqueMatchCount" #Set search threshold, logic used is ge (greater than or equal to) $search_threshold = 2 # END CONFIG # #Logging function function logit ($code, $message) { #Change these values to match what you want, this function assumes it will log #to the directory the script originated from with a file called logit.txt #If you put this function in "test.ps1" for instance and called it with these examples #you would get indicated results. #Example call: logit 1 "hello" #Example Result: Date/Time - test.ps1 - ERROR - hello #Example call: logit 0 "test" #Example Result: Date/Time - test.ps1 - INFO - test #Example call: logit 2 "warning test" #Example Result: Date/Time - test.ps1 - WARN - warning test #Code Mappings #By default, 0 is info, 1 is error and 2 is warn when using logit. Add more to the array if needed. #Array starts at 0, so don't change first 3, if you add a fourth element it will be #code number 3, 5th would be 4, etc. $codeArray = @("INFO","ERROR","WARN","ERROR","UPDATE","DEBUG") $messagetype = $codeArray[$code]
  • 22. #Determine what this script is called and the path. $Invocation = (Get-Variable MyInvocation -Scope 1).Value #$scriptpath = Split-Path $Invocation.MyCommand.Definition #Two options for scriptname, if you want full path and extension use the second one. #If you just want the script name without path or extension when logging use the first. #For best operation make sure one of these lines is commented out. $scriptname = $MyInvocation.Scriptname.Split('') | Select-Object -Last 1 #$scriptname = $MyInvocation.ScriptName #Determine date and time $date = Get-Date #Create Logfile if it doesn't exist and open for appending always. #If you want the logfile somwhere else simply replace the path/filename below. <# If(Test-Path $logfile) { #Logfile exists, continue. } Else { #Logfile doesn't exist, create it and continue. new-item $logfile -type file } #> $logstring = "$date - $scriptname - $messagetype - $message" Write-Host $null
  • 23. if( $code -eq "1" ) { Write-Host "$logstring" -ForeGroundColor Red } if( $code -eq "2" ) { Write-Host "$logstring" -ForegroundColor Yellow } if( $code -eq "0" ) { Write-Host "$logstring" } if( $code -eq "3" ) { #Adding this for errors that don't require intervention and should just be revewied in the logs. Write-Host "$logstring" -ForeGroundColor Red } if( $code -eq "4" ) { #Adding this so that AD changes show up green visually as script is run Write-Host "$logstring" -ForeGroundColor Green } if ($code -eq "5" ) { Write-Host "$logstring" -ForegroundColor Cyan if ($debugPausing -eq "1") { pause }
  • 24. } Write-Host $null Add-Content $logfile "$logstring" if ( $code -eq "1" ) { pause } } function sendEmail ($ef_to, $ef_from, $ef_subject, $ef_body, $ef_attachment) { #Function to send email #Configure custom header values if you wish #CONFIG $custom_headers = "yes" $smtpServer = "SMTP SERVER NAME" $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = "$ef_from" $msg.ReplyTo = "$ef_from" $msg.To.Add($ef_to) $msg.subject = "$ef_subject" $msg.body = $ef_body $msg.IsBodyHtml = $true if ($custom_headers = "yes") { #Example: #$msg.Headers.Add("CCAccntCreate", 1)
  • 25. #You can add more than one in sequence $msg.Headers.Add("CCAccntCreate", 1) } $msg.IsBodyHtml = $true $msg.Body = "$ef_body" #Add the attachment if it is there if($ef_attachment -ne $null) { $msg.Attachments.Add($ef_attachment) } $smtp.Send($msg) } function successCheck() { #Reports success of the operation before the one that calls it. if($?) { logit 0 "Operation was Successful!" } else { logit 1 "Operation Failed!" $error_text = $error[0] logit 2 "Error Received by SuccessCheck: $error_text" } } #Set up logging file
  • 26. $logs_folder = "$root_folderlogs" if (!(Test-Path $logs_folder)) {New-Item -ItemType Directory $logs_folder} $logstamp = date -format MM-dd-yy-hh-mm-ss $logfile = "$logs_folderrecord_check_log-$logstamp.txt" logit 0 "Script running..." $csv_files = Get-ChildItem -Path "$root_folder" -Filter "*.csv" foreach ($file in $csv_files) { $file_fullname = $file.FullName $file_basename = $file.BaseName $file_processed_name = "$root_folderprocessed$file_basename-processed-$logstamp.csv" logit 0 "Processing file: $file_fullname" $csv_data = Import-CSV $file_fullname $count = 0 $new_csv_file = "$root_folderoutput$file_basename-filtered-$logstamp.csv" foreach ($line in $csv_data) { $search_value = $line.$search_field if ($search_value -ge $search_threshold) { #Write the line to a new CSV file logit 0 "Found matching line, adding to $new_csv_file" $count++ logit 0 "Match count for file: $file_fullname is now $count" $line | Export-CSV $new_csv_file -Append -NoTypeInformation }
  • 27. } if (Test-Path $new_csv_file) { #Send email to notify that file was made logit 0 "Sending email notification..." sendEmail $email "FROM ADDRESS" "Informatica Duplicate Records Found" "Record check found <b>$count</b> lines where <b>$search_field</b> was greater than or equal to $search_threshold in original file: <b>$file_fullname</b><br><br>Matching lines saved to new file: <b>$new_csv_file</b>" } logit 0 "Finished with file: $file_fullname" #Move CSV file to processed directory when done with it. logit 0 "Moving original file from $file_fullname to $file_processed_name" Move-Item $file_fullname $file_processed_name }