Removing Redundant data in documentlist

Hello,

I’ve been stuck trying to remove redundant values in document list.
Scenario: I have an document list input. then i have to map those inputs to a structured output.

Input:
documentList:
var_1
var_2
var_3
var_4

structured output:
document:
var_1_goes_here
documentList:
var_2_goes_here
another_documentlist:
var_3_goes_here
var_4_goes_here
Then if i have an input that are supposed to be unique but some fields are redundant:
say: input[0]:
var_1: VALUE
var_2: VAR_AAA
var_3: VAR_BBB
var_4: VAR_CCC
input[1]:
var_1: VALUE
var_2: VAR_ANOTHER
var_3: VAR_BBB
var_4: VAR_CCC
I tried looping and var_3 and var_4, would also map the values even if redundant.

Hi Mark,

can you provide some screenshots of the document structure representations as well as a screen shot of your current implementation please?

This might help us understanding your issue, the code snippet above is hard to read and understand.

Regards,
Holger

you can use this java service to remove dups in the document

IDataCursor pipelineCursor = pipeline.getCursor();
String list = IDataUtil.getStringArray( pipelineCursor, “list” );
Set s = new HashSet();
s.addAll(Arrays.asList(list));
String result = s.toArray(new String{});
IDataUtil.put( pipelineCursor, “result”, result );
pipelineCursor.destroy();

Hi Guys,

I think M@he$h answered my question. Thank you all.