Designing and Executing Map : Setting Up Targets Using Multimode Connectors : Using a Multimode Target Connector in JSON Map
 
Share this page                  
Using a Multimode Target Connector in JSON Map
To use a multimode target connector in a JSON Map:
1. In the Map Editor, on the Sources tab, select the required source connector, specify the connection information and click Connect.
2. On the Targets tab, select the required multi-mode connector from the Choose Connector drop-down menu.
3. Specify the connection information that is required to connect to the required database or file. For example, Target Database Alias, Data Source, User ID, and so on for a database connection and File for Excel (xlsx).
4. Click icon next to Schema Selector.
The Multimode Table/View Selector dialog is displayed. Select the required table schemas. The selected table schemas provide the required structure to visually represent the table(s) or file(s) as a record layout (named as selected table name plus "_1") on the Mapping tab.
A default Target record layout R1 is automatically created when the target connector is selected. Make sure to select the Replace existing layouts option on the window, if you want to use the selected table (file) as a record layout.
If you want to write to a new table or file using a schema that does not exist, then perform step 7 and 8 to add additional record types to your map.
5. Specify the values for the connector properties if the default values are not appropriate. For more information about connector properties, see the connector specific topics available in the Connectors section.
6. Click Connect.
The connection is established with the target. You can now map the source fields to the target. If you want to disconnect from the target, click Disconnect.
7. In the map editor, click the Mapping tab and then do the following:
a. In the Simple view, right-click a target field and select Set Actian Key to set the key field to perform an update or delete operation for the target. You may set more than one key field, which will be in priorities with the orders of these key fields.
b. Click the Advanced View icon.
In this view, the Mapping tab is split into four quadrants. To complete setting up the tables or sheets, in the Target tree view, navigate to All Record Types node and/or the All Record Instances node:
All Record Types: Select this node if you want to add one or more record layout(s) to the map (if the table or sheet does not exist) and build the schema manually. See step 8 for creating new record types.
All Record Instances: Select this node and open the Properties window from the selected instance grid. In the Properties window, specify the Target Object Name (database table or Excel sheet associated with the record instance) and Target Operation (output modes are insert, update, delete, and upsert). You must set these properties for each record type or instance in the map.
8. To add a new record layout to the map, click All Record Types and then click Add Record Type icon . A new record type is added with a default Name and Length as 0. You can edit the Name in the target grid (lower right quadrant). The Length is automatically updated after the fields are mapped to this new record type.
9. To map the source fields to this new record instance:
a. In the Targets node (lower left quadrant), expand the new record instances until you see the required record instance (selected table name plus “_1”).
b. Click the required record instance to display the record layout in the lower right quadrant.
c. Navigate to the appropriate view in the Sources node in the upper left quadrant and drag/drop those fields to the new target.
10. To create any tables or sheets that do not exist:
a. Go to the Configuration tab > Map Events section, and click the icon.
The Add Map Events window is displayed.
b. In the Events section, click and select TransformationStarted from the list.
c. On the True Actions tab > Actions section, click and select TableOperation action for the TransformationStarted event.
d. In the Action Parameters section, specify the following:
operation type - Select the value as Create.
target record address - Select the appropriate table or sheet name. You may have to add additional operations to drop or truncate this table if the map is run multiple times.
11. After all the Record Types are created, you must set the Target Object Name and Target Operation properties for each record instance. To set these properties:
a. Click All Record Instances node in the Targets quadrant (lower left quadrant).
The lower right hand quadrant displays the grid or table for All Record Instances. The Properties column displays the icon for each entry in the grid.
b. In the Properties column, click on the icon for the required entry in the grid.
The Properties dialog box is displayed.
c. Change the values for Target Operation (output mode) and Target Object Name (table or sheet name) to the required output mode and table/sheet name.
d. Click OK to save the changes.
Repeat this process for each record instance that appears in the grid.
12. Complete mapping the fields to the record instances/layouts and/or add any required EZscript expressions.
13. Define the appropriate events and actions for your map. For each record instance, a separate event and action must be set. For information on adding events and actions, see Managing Events and Actions in Advanced View.