cancel
Showing results for 
Search instead for 
Did you mean: 

Node Creation

Former Member
0 Kudos

Hi everyone,

   I have a requirement like one field repeats multiple times (0-unbound).

   If the field contain the same values at each repetitive node then it has to create target node.

  

   If the value changes at any node it does not create the target node.

   Is there any approaches for this scenario. If any UDF's please post the same.

Thanks

Dileep

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor
0 Kudos

Hi Dileep,

You could do something like this that would only map the source to the target if there is one unique value:

Regards,

Ryan Crosby

Answers (3)

Answers (3)

ambrish_mishra
Active Contributor
0 Kudos

Use standard function, splitByValue (Value changed)

Ambrish

former_member184720
Active Contributor
0 Kudos

You can write  UDF something like below..

your field -> remove context-> UDF -> Target Node

String a = "0";

for (int i=1; i<var1.length; i++)

{

    if (var1[i-1] != var1[i])

        a = "1";

}

if (a.equals("0"))

{

result.addValue(" ");

}

I think you should be able to achieve with graphical mapping by using count function on field and node level..

vicky20691
Active Contributor
0 Kudos

Hi Dileep,

Your requirement is a little unclear.

example: Is it that if there is a node <name>abc</name> and next time if <name>abc</name> come a target node will be created. But if a node <name>xyz</name> comes the target node will not be created?

Is this the requirement?

Regards,

Vikas

Former Member
0 Kudos

yes