Custom Activity allows manual transformation of Data object using Python with rules for mapping, transformation and validation. It is used for data transformations that can’t be done using other standard Dataflow Activities.
Executed Script will interact with Dataflow’s data model related to the previous dataflow step.
item["DurationToTime"] = datetime.datetime.fromtimestamp(item["duration"]["minutes"]*60).strftime("%H:%M:%S") if item["duration"] != None else None
// Transform time from minutes to hours in Hours:Minutes:Seconds format
item["CreatedToDate"] = DateTime.Parse("01/01/1970").AddMilliseconds(item["created"]) if item["created"] != None else None
// Transform date to ticks since 01.01.1970
if item["full"]["_Date"] == None: // Check if field _Date present
item["validationMessages"]["_Date"] = 'Date needs to be set' // Error message
item["hasError"] = True // This flag can be checked inside the Dataflow