Does anyone have an example ETM datamapper that checks the existance of an object (could be an Item, Section, Department, Cost Center, etc.), and if it’s not found, to have it created?
In the process of importing my Contact Users through ETM, we are providing the values for Section, Department, Building, Cost Center, Job Title, etc. The issue I am running in to is that there are sometimes values in the CSV that we are importing for something, we’ll use Section, that doesn’t exist in Assyst. What I am currently doing is exporting the list of existing Sections via the DMW, then comparing it to the distinct values in our CSV import, then manually adding any that are missing in Assyst.
What I would rather do is create a datamapper that first goes through the import CSV, just looking at the Section column, and checking to see if it exists in Assyst yet. If so, skip, if not, create it. That way, I can get any missing Sections, Buildings, etc. added to Assyst BEFORE I do the user import, so that there are no missing values.
What I cannot seem to figure out is how to set up the datamapper to do that. To take the value in say column J, check to see if there is a matching Section shortcode to the value in that column, then if not, create it, then move to the next row and do the same process again. I know how to set it up to Create a new Section, I just don’t know how to set it up to first check if it exists and skip if it does. I tried the Wiki, but I couldn’t wrap my head around it. Any help would be appreciated.
ETM example of creating an object if it doesn't exist
Best answer by Rajana
This is possible.
You need separate data mappers for each property of the contact user.
For an example : when you are creating/updating a contact user, lets assume the user alias is not available in assyst. So ETM needs a data mapper placed in the channel before the contact user data mapper. In that user alias data mapper, you need to set “No value” field which will skip creating a new assyst user if one already exists.
In the csv file, you need to provide all the details including contact user’s and other property (user alias, section, job role) details if ETM needs to create one.
In the user alias data mapper, you can use a “record to update” field to find if the assyst user exists in assyst.
Then use outbound.self variable in the “no value when” field to skip creating new one.
Attached a sample channel with data mappers. This will create a contact user and a user alias (if alias does not exist)

Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.