Share

Retrieve the Properties of an Event

Definition: getProperties() → dict
Description: Fetches the properties of an Event as key-value pairs.
Parameters: This method does not take any arguments.
Returns: A dictionary containing the key-value pairs of all the properties of the Event.

The following script fetches the dictionary of properties from an Event:

from io.hevo.api import Event

def transform(event):
    # Get properties from the Event
    <existing_properties> = event.getProperties()

    return event

Sample Transformation

The following script demonstrates how this function can be used to modify the Marks property in the Student.Sheet1 Event:

from io.hevo.api import Event

def transform(event):
    # Get properties from the Event
    properties = event.getProperties()
    # Normalize marks to between 0 and 50
    properties['Marks'] = properties['Marks'] * .5
    return event

Sample Output

The Transformation retrieves the properties of the Student.Sheet1 Event and reduces Marks from 73 to 36.5.

Retrieve Properties


Last updated on May 30, 2023

Tell us what went wrong

Skip to the section