Hi Team
I have a date datefield storing current datetime in it want to create a UUID using same column how i can create . currently using groovy script to create UUID but want to use same column and create it
Hi Team
I have a date datefield storing current datetime in it want to create a UUID using same column how i can create . currently using groovy script to create UUID but want to use same column and create it
Best answer by Bikram
I tried this in jython , kindly try it in your pipeline and let me know if it helps.
from datetime import datetime
from uuid import uuid4
date_time = datetime.now().strftime('%Y%m-%d%H-%M%S')
eventid = date_time + str(uuid4())
for record in sdc.records:
try:
record.value['data'] = eventid
# Write record to processor output
sdc.output.write(record)
except Exception as e:
# Send record to error
sdc.error.write(record, str(e))
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.