Something I have some stuff which converts to unicode.
Process records:
for fieldName in in1:
out1[fieldName] = unicode
Configurefields:
for fieldName in in1:
if in1[fieldName] is not Null:
out1[fieldName] = unicode(in1[fieldName], "utf-8")
You can do something similar for integers.
--
Suggestion for field type checking and conditional execution - do something like this:
if isinstance(x['type'],unicode):
...
elif isinstance(x['type'],dict):
...
if isinstance(x['type'], list):
..
etc
------------------------------
Peter Sykes
Data Governance & Architecture
Vontobel Holding AG
Zurich
------------------------------
Original Message:
Sent: 02-08-2024 15:46
From: Geoff Geoff
Subject: Check field type and Convert to int dynamically in a transform node?
I am trying to read all the fields in and convert them to integer....
i know this isnt right.. but something like this
so no matter how many fields you feed in, it will convert them all to integers type
i=0
while i < len(inputs[0]):
outputs[0][inputs[0][i].name] =str
i=i+1
I would also like to know how to check the field type for data transformation...
like:
If inputs[0][i] is Date:
do this....
elif inputs[0][i] is string:
etc...
------------------------------
Geoff Geoff
Windstream Communications
Little Rock AR
------------------------------