Forum Discussion

abalas4's avatar
abalas4
New Contributor
9 years ago

clear property values for all rows in Data Sink using groovy

I want to read a json response of a Rest api and populate datasink with that data. The rest api could result in several rows of data. I will be running this several times a day. So everytime I run this I want to clear the property values in data sink for all the rows.

 

I  tried the following as suggested in one of the forums but this clears the data only for the first row. How do I clear the datasink for all the rows? 

 

String[] props = new String[dataSink.getPropertyCount()]
props = dataSink.getPropertyNames();
log.info("Property size:" + props.size())
for (int i=0;i<props.size();i++)
{
dataSink.setPropertyValue(props[i],"")
}

 

 

No RepliesBe the first to reply