Skip to main content

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.

Number of Parameters : 1

 
Parameter : Pycode



In

## Pycode example

#### Input Data with multiline json

```json
{
                "attributeid": 212077,
                "attributename": "SKU",
                "attributevalue": "999898",
                "attribute_groupid": 24315,
                "attribute_groupname": "Default",
                "Isvariant": "false"
            }
            {
                "attributeid": 212078,
                "attributename": "Product Name",
                "attributevalue": "Pim Item Update Testing",
                "attribute_groupid": 24315,
                "attribute_groupname": "Default",
                "Isvariant": "false"
            }
```

### Below is the belowpycode exampleops

 When we arewant writingto run a newscript pythonfor code,the data which is flowing. In this code is meant to transfer attribute names and values fromcase the "_data"data dictionarywill tobe separatestored variablesin (attributename`pycode_data` andvariable, attributevalue)so anduse thenthis addvariable themfor backmaking tochanges thein dictionarydata withusing ayour newscript.
```python
Responsedata key-value= pair ("new_key":"new_value").[]

keyname = ["attributename"]

keyvalue = ["attributevalue"]
for i in keyname:
    attributename = _data.pycode_data.pop(i, None)
for j in keyvalue:
    attributevalue = _data.pycode_data.pop(j, None) _data[
pycode_data[attributename] = attributevalue
```
In _data.update({"new_key":"new_value"})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

```json
{
                "attributeid": 212077,
                "SKU": "999898",
                "attribute_groupid": 24315,
                "attribute_groupname": "Default",
                "Isvariant": "false"
            }
            {
                "attributeid": 212078,
                "Product Name": "Pim Item Update Testing",
                "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

  1. source has the json data of the previous operation
  2. target is the json data after performing the filter operation
  3. Conditional Statement is the parameter where we include logical operators (and ,or, not),Identity operators(is ,is not),membership operators (iin,not in),comparisional operators(==,!=,>, <,<=,>=)

Note : 'data' is fixed in the statement, we can change name of 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 vale 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'