cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to read column names dynamically.?

praveenbathula
New Contributor

How to read column names from source dynamically, to perform some logic on columns.? with out hard-coding each column name in hasOwnProperty(). For example if I have a null values in records, I want those columns to write into separate file.

2 REPLIES 2

stephenknilans
Contributor

I donโ€™t know if there is a best practice for this, but one thing you CAN do is run it through a mapper, set to handle null fields, and as pass through, enter EVERY known field as source, and donโ€™t provide a target. That should give you a result that contains NOTHING, but the fields you didnโ€™t specify. Handle null fields apparently only means that it handles source values that donโ€™t exist, EVEN if the field itself doesnโ€™t exist. HOWEVER, if null data DOES exist, it comes across as null.

Thanks stephen, will try implementing the same.