Directory Wizards Inc.

Solutions For Your Directory Needs

RSS feed
Add to Google


 

Categories

Knowledgebase

Custom Macro Mapping using a Lookup Table

Category:Map Files

Last Updated:2011-08-18

 

Download PDF version

 

You may have one source attribute (i.e. School Location Code) from which you want to automatically define certain destination values.

 

You can do this with a Lookup Table and custom mappings.

 

The lookup table and the corresponding mappings may include a prefix. This allows the lookup values to apply to specific attributes... Thus allowing them to be combined effectively to automatically set destination values based on a specific source value.

 

The best way to explain this is by example:

 

Lookup.txt

 

SchoolName 123|Albuquerque High School
SchoolPhone 123|555-827-0919
PrinPhone 123|555-123-4567
SchoolFax 123|555-827-0581
SchoolStreet 123|7007 Jones Road
SchoolCity 123|Albuquerque

 

SchoolName 456|Denver High School
SchoolPhone 456|555-111-1234
PrinPhone 456|555-111-1235
SchoolFax 456|555-111-1236
SchoolStreet 456|5005 Welch Road
SchoolCity 456|Denver

 


Mappings:

 

LocationCode=^School_Location_Code^
SchoolName=?SchoolName ^School_Location_Code^?
SchoolPhone=?SchoolPhone ^School_Location_Code^?
PrincipalPhone=?PrinPhone ^School_Location_Code^?
SchoolFax=?SchoolFax ^School_Location_Code^?
SchoolStreet=?SchoolStreet ^School_Location_Code^?
SchoolCity=?SchoolCity ^School_Location_Code^?

 

Output:


1) locationcode,schoolname,schoolphone,principalphone,schoolfax,schoolstreet,schoolcity
2) 123,Albuquerque High School,555-827-0919,555-123-4567,555-827-0581,7007 Hector Road,Albuquerque
3) 456,Denver High School,555-111-1234,555-111-1235,555-111-1236,5005 Welch Road,Denver
4) 888,SchoolName 888,SchoolPhone 888,PrinPhone 888,SchoolFax 888,SchoolStreet 888,SchoolCity 888
5) ,SchoolName ,SchoolPhone ,PrinPhone ,SchoolFax ,SchoolStreet ,SchoolCity

 

Line 1 is the column headers
Lines 2 & 3 represent output for source records that contain codes that appear in lookup.txt
Line 4 represents output for a source record that HAS a School Code, but the codes does not appear in lookup.txt
Line 5 represents output for a source record that has no School Code.