Mapping and Modifiers
The Mapping node is used to link data from a Source system to a Destination system. The data that is being mapped is formatted using Modifiers.
Introduction
Mapping in DCKAP Integrator is used to link data from a source system to a destination system. Data from the source fields are formatted using Modifiers and then mapped to the associated destination fields.
Integrations or Pipes are the components that process the data synchronization based on the associated Flows and Mapping configurations. Based on the selected credentials, every pipe is associated with one Flow. The Flow may/may not contain one or more Mapping nodes that are added while developing the Flow.
More on Integrations can be found here.
More on Flows can be found here.
Concept of Mapping
Flows are the neural schema of every integration. A flow determines how the data should be synched end to end. A flow usually contains one or more Mapping nodes, which will format and link data from the source system to the destination system.
In the Flow, the API calls to be used in the mapping node are defined.
These API calls are configured in the API manager either used to get data or post data. Also, sample response and request fields are added while configuring these APIs.
More on API Manager can be found here.
The fields from the sample 'Request' and 'Response' are then used in the Mapping nodes as source and destination fields respectively.
Creating a New Pipe
Open the Integrations tab and click on Add New.
In the Add Pipe page, enter a Pipe Name and select Credentials (systems).
Once the Credentials have been chosen, all the Flows associated with those systems will be listed in the drop-down menu. Choose a Flow.
After a flow has been selected, all the Mapping nodes defined in the Flow will be displayed as Mapping cards.
Click on Configure to make changes to the Mapping nodes.
Mapping Configuration
Click on Configure in the Mapping Card and a new window will open where you can
Link fields
Format data
Modify data using modifiers
Add custom fields
Preview the mapping configuration
Import or export mapping configurations
Here you will see Source fields on the Left-Hand side and Destination fields on the Right-Hand side. These fields are extracted from the sample Request and Response sections in the API Manager.
How is Mapping done?
Drag and drop fields onto the Mapping area in the center.
For example:
first_name, last_name from the source mapped to customer_name, name in the destination
email in the source to email_address in the destination.
Add Custom Field
The Add Custom Field is used to add a new data value to the Source Field which can then be modified and sent to the destination.
Remember to hit the Save button after you have used the Modifier feature.
Fields for which Modifiers have been applied in the Play area, cannot be directly removed from the Mapping page.
If any field from that is used in the Play area is removed from the API manager response, then that corresponding field (row) wil be highlighted in the Mapping play area.
Comment Mapping
A specific mapping configuration can be temporarily disabled by using the Comment option.
Preview Mapping
The Preview Mapping is used to test and get a preliminary view of how the Mapping functionality will work, instead of testing the entire Integration, thereby saving the developer's time.
Click on the Preview button in the top left section of the Mapping page. The Preview Mapping window will open.
Source Data: In this section, add the Source field data in JSON format.
Ignore Keys: Keys that should be ignored by the system, while processing data in the mapping structure defined by the user.
Click on the Preview button. Depending on the Source data provided and the Mapping and Modifier configurations, the preview response will display the output in the format of the respective destination fields.
Save Options
Save & Continue: To save the Mapping and remain on the same page
Save & Exit: To save the Mapping and return to the Pipe page
Use Case
Modifier Functions
Modifiers may be added to each field that is mapped or to the link that connects two fields. The Modifier is used to edit or format data from the source fields.
How to configure Modifiers?
Drag one or more Source fields and drop it to the Play Area.
Then one or more Modifier functions maybe added to the source fields and also the link. Select the field and then Drag and Drop the modifier functions to the Configuration area or Play Area.
The Group feature is used to group one or more fields. The Grouped entity can then be used as a single field for modification.
Use the Preview section to test the Modifier functionality. The input format of the data to be modified can be selected by clicking on the drop down list in the Preview section.
Example: firstname (concatenate) lastname. The output of this modifier is mapped to the destination fields.
BUILT IN FUNCTIONS
int
bit_length
Returns the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros.
conjugate
Returns the complex conjugate of any int.
list
Append
Adds an object to the end of the list.
count
Returns the number of occurrences of a value in the list.
extend
Extends list by appending elements from the iterable.
index
Returns the index of the first occurrence of the specified list item. Raises ValueError if the value is not present.
insert
Inserts an object at the specified index position.
pop
Removes and returns an item at the specified index (The default is to return the last item in the list). "IndexError" error is raised if list is empty or index is out of range.
remove
Remove first occurrence of value. Raises ValueError if the value is not present.
reverse
Reverse *IN PLACE*
sort
Stable sort *IN PLACE*
Str
capitalize
Return a capitalized version of the string, i.e. make the first character have upper case and the rest lower case.
center
Return S centered in a string of length width. Padding is done using the specified fill character (default is a space).
count
Returns the number of non-overlapping occurrences of substring sub in string.
encode
Encode S using the codec registered for encoding. Default encoding is 'utf-8'.
Errors may be given to set a different error handling scheme. The default value is 'strict' meaning that encoding errors raise a UnicodeEncodeError.
Other possible values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
endswith
Returns True if the String ends with the specified suffix; False otherwise. With optional start, tests the String from the beginning at that position. With optional end, stop comparing S at that position. Suffix can also be a tuple of strings to try.
expandtabs
Return a copy of S where all tab characters are expanded using spaces. If tabsize is not given, a tab size of 8 characters is assumed.
find
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
index
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
isalnum
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.
isalpha
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.
isdigit
Return True if all characters in S are digits and there is at least one character in S, False otherwise.
islower
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.
isspace
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.
istitle
Return True if S is a titlecased string and there is at least one character in S, i.e. upper- and titlecase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise.
isupper
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.
join
Return a string which is the concatenation of the strings in the iterable. The separator between elements is S.
ljust
Return S left-justified in a Unicode string of length width. Padding is done using the specified fill character (default is a space).
lower
Return a copy of the string S converted to lowercase.
lstrip
Return a copy of the string S with leading whitespace removed. If chars is given and not None, remove characters in chars instead.
partition
Search for the separator sep in S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return S and two empty strings.
replace
Return a copy of S with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.
rfind
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
rindex
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
rjust
Return S right-justified in a string of length width. Padding is done using the specified fill character (default is a space).
rpartition
Search for the separator sep in S, starting at the end of S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return two empty strings and S.
rsplit
Return a list of the words in S, using sep as the delimiter string, starting at the end of the string and working to the front. If maxsplit is given, at most maxsplit splits are done. If sep is not specified, any whitespace string is a separator.
rstrip
Return a copy of the string S with trailing whitespace removed. If chars is given and not None, remove characters in chars instead.
split
Return a list of the words in S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result.
startswith
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
strip
Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead.
swapcase
Return a copy of S with uppercase characters converted to lowercase and vice versa.
title
Return a titlecased version of S, i.e. words start with title case characters, all remaining cased characters have lower case.
upper
Return a copy of S converted to uppercase.
zfill
Pad a numeric string S with zeros on the left, to fill a field of the specified width. The string S is never truncated.
Converter
converter
To Modify the data with a static raw data from the user input
Eg:- Original data {country:"India"}
Requested Modification {country:"IN"} :returns: Modified JSON data
The Swap option will allow users to interchange the Key and Value data.
Example of Default value:
key= "__default__"
value= "US"
If the key is an empty key or any key other than IN it will take the default value "US".
CUSTOM
1. 12Hr to 24Hr Converter and 24Hr to 12Hr
Converts Time from one format to the other (12Hr clock to 24Hr clock and vice versa).
2. Array Extender
Used to Concatenate two or more strings and then convert the output of the concatenation into a single string.
Applicable Only To Lists.
3. Array or String Slicing
To slice values from the string/array
All the above examples applies to arrays as well:
param start_index: Index of the element from where you want to start the slicing operation
param stop_index: Index of the element where you want to stop the slicing operation
param step: Specifies the steps that you want to make during the slicing operation
4. Array To String
To convert any datatype to string if its dict. Applies json dumps if its list, set, tuple. Joins the iterable elements using join function.
5. Concatenate
Used to Concatenate two or more strings and, convert the output of the concatenation into a single string.
6. Convert Non-ASCII characters to ASCII Characters
7. Converter
To Modify the data with a static raw data from the user input
Eg:- Original data {country:"India"}
Requested Modification {country:"IN"} :returns: Modified JSON data
The Swap option will allow users to interchange the Key and Value data.
The Converter modifier in the CUSTOM modifier section can be used in conjunction with other Modifiers.
Example of Default value:
key= "__default__"
value= "US"
If the key is an empty key or any key other than IN it will take the default value "US".
8. Current Datetime
Used to display the current date and time in the project timezone.
9. Datatype Converter
To convert the the source value to requested datatype
string
integer
dict (requires tuple of key and value pairs)
list
float
10. DateTime Formatter
To convert the date_value to the requested format from current format.
Complete list of format codes:
Format Codes
Description
Example
%d
Day of the month as a zero-padded decimal number
01, 02, 03, 04 …, 31
%a
Weekday as abbreviated name
Sun, Mon, …, Sat
%A
Weekday as full name
Sunday, Monday, …, Saturday
%m
Month as a zero-padded decimal number
01, 02, 03, 04 …, 12
%b
Month as abbreviated name
Jan, Feb, …, Dec
%B
Month as full name
January, February, …, December
%y
Year without century as a zero-padded decimal number
00, 01, …, 99
%Y
Year with century as a decimal number
0001, …, 2018, …, 9999
%H
Hour (24-hour clock) as a zero-padded decimal number
01, 02, 03, 04 …, 23
%M
Minute as a zero-padded decimal number
01, 02, 03, 04 …, 59
%S
Second as a zero-padded decimal number
01, 02, 03, 04 …, 59
%f
Microsecond as a decimal number, zero-padded on the left
000000, 000001, …, 999999
%I
Hour (12-hour clock) as a zero-padded decimal number
01, 02, 03, 04 …, 12
%p
Locale’s equivalent of either AM or PM
AM , PM
%j
Day of the year as a zero-padded decimal number
01, 02, 03, 04 …, 366
11. Datetime to Timestamp Modifier
This Modifier is used to provide the timestamp starting from <MM/DD/YYYY> to a given Date & Time input.
Give the input as a string
In the Parameters field, pass the string format using the table
Provide the timezone of the user input
The supported timezone parameters are listed here: Supported Timezones
12. Email Validator
To validate the email address. If valid, return the email address, else return the default value.
13. Expression
Based on the logical operations that the user requests, the resulting data will be calculated.
14. Find and Match Key value
To convert any datatype to string if its dict. Applies json dumps if its list, set, tuple. Joins the iterable elements using join function.
15. Get Index Value
To get the index value from string or list datatype.
16. Group
Grouping will apply precedence over the grouped elements.
17. Mathematical Operations
To perform Arithmetic operations such as:
Addition
Subtraction
Multiplication
Division
Floor division
Power of
Modulo operation (remainder)
18. Multiple String to Array
Used to push two or more string into an array.
19. Number from String Modifier
This method is used to retrieve numbers from the address string.
Parameters:
index: Index of the number to be retrieved
20. Push Into an Array
To push elements into a new array.
21. Raw Value
The value assigned to Raw Value will be taken into consideration.
22. RegEx
A RegEx, or Regular Expression, is a sequence of characters that forms a search pattern.
RegEx can be used to check if a string contains the specified search pattern.
23. Remove Non-ASCII characters from the input data
24. Remove Special Characters
To remove special characters from a string.
Provide either selections or exceptions. If both the selections and exceptions are provided, selections will be used.
25. Round Off
To round off to the nearest integer value
26. Truncate
Removes the specific number of characters in the prefix or suffix of a string based on the parameters provided. By default, characters from the right of the string are removed.
27. 12Hr to 24Hr Converter and 24Hr to 12Hr
Converts Time from one format to the other (12Hr clock to 24Hr clock and vice versa).
Last updated