AnsweredAssumed Answered

How can we return unique count of a field in a map or a profile?

Question asked by priyankas9531 on Jul 23, 2015
Latest reply on Aug 4, 2015 by priyankas9531



I referred the article on this link - and it is not giving me any error as well but when i am trying to return the count to a message or a profile, i am not getting anything.
Could someone please tell me how i can do that?
I am using a Document Process Property before my data process where this script is placed and the name of the process property is DOC_COUNT.
Script -


import java.util.Properties;
import com.boomi.execution.ExecutionUtil;


ExecutionUtil.setExecutionProperty("Count", String.valueOf(dataContext.getDataCount()));


for( int i = 0; i < dataContext.getDataCount(); i++ )
  InputStream is = dataContext.getStream(i);
  Properties props = dataContext.getProperties(i);


  dataContext.storeStream(is, props);
String  p = String.valueOf(dataContext.getDataCount());
return p;