Data Pipeline Controls
Sleep Time
Description:
Sleep Time operation helps in giving a pause of some seconds which is defined by the user.
Number of Parameters : 1
Parameter : Sleep Time
It specifies the sleep time duration in seconds.
Below is an example where we are keeping sleep time duration of 60 seconds.
60
Python Operation
Description:
Python operation helps in when a user has a particular need or requirement to perform a special operation that is not predefined, a user can develop a new operation that will meet their unique requirements.
Python Operation Parameters to Know When Writing Python Code
When writing Python code for this operation, it is important for users to be aware of the following parameters:
1. Responsedata = []
Description: Always start your Python script for this operation by initializing Responsedata as an empty list. This serves as a placeholder for appending any results. By keeping Responsedata as an empty array, users can easily append their results to this variable as needed.
2. pycode_data
Description: This variable holds the data that is flowing in the Integration Bridge. If you want to make changes to the existing data using a Python script, you need to use pycode_data and write your script according to this variable.
These parameters are essential for effectively utilizing the Python operation in your scripts, ensuring that your code interacts correctly with the data flow and result handling within the Integration Bridge.
Number of Parameters : 1
Parameter : Pycode
Pycode example
Input Data with multiline json
{
"attributeid": 212077,
"attributename": "item_no",
"attributevalue": "999898",
"attribute_groupid": 24315,
"attribute_groupname": "Default",
"Isvariant": "false"
}
{
"attributeid": 212078,
"attributename": "Product Name",
"attributevalue": "Product ABC",
"attribute_groupid": 24315,
"attribute_groupname": "Default",
"Isvariant": "false"
}
Below is the pycode ops
When we want to run a script for the data which is flowing. In this case the data will be stored in `pycode_data` variable, so use this variable for making changes in data using your script.
Responsedata = []
keyname = ["attributename"]
keyvalue = ["attributevalue"]
for i in keyname:
attributename = pycode_data.pop(i, None)
for j in keyvalue:
attributevalue = pycode_data.pop(j, None)
pycode_data[attributename] = attributevalue
In the above example we can see that we are running a script to make changes in the existing data so we are using `pycode_data` variable.
Output data after applying Python Pycode
{
"attributeid": 212077,
"item_no": "999898",
"attribute_groupid": 24315,
"attribute_groupname": "Default",
"Isvariant": "false"
}
{
"attributeid": 212078,
"Product Name": "Product ABC",
"attribute_groupid": 24315,
"attribute_groupname": "Default",
"Isvariant": "false"
}
Filter Operation
Description:
if else is called as the filter operation in eZintegrations, basically it has 1 parameter: Conditional Statement
- Source has the JSON data of the previous operation.
- Target is the JSON data after performing the filter operation.
- Conditional Statement is the parameter where we include logical operators (and, or, not), Identity operators(is, is not), membership operators (in, not in), comparisional operators(==,!=,>, <,<=,>=)
Note: 'data' is fixed in the statement, we can change the name of the key and value as per requirement.
List of Operators that can be used : [==, !=, <, >, =<, =>, or, and]
Example 1: Filtering data where Order Status is pending
data['Order Status']=='pending'
Example 2: Filtering data where the value of "id" is 5 or 6.
data['id']==5 or data['id']==6
Example 3: Filtering data where order status is not failed and placed before a specific date.
data['Order Status']!= 'failed' and data['Date']<'6/03/2022'
Various Use Cases for Filter Operation:
Scenario 1 With one filter condition and one target.