cancel
Showing results for 
Search instead for 
Did you mean: 

group the array data as single context

Former Member
0 Kudos

Hi Everybody,

I have R3 data which consists of two fields namely CategoryID and CategoryName as follows:

CatID CatName

0001 AAA

0001 AAA

0001 AAA

0002 BBB

0002 BBB

0003 CCC

.

.

and So on... Now I want to take the CatID and map it to a context element for each catID a context element will be created dynamically.

eg:

I need Output as :-

CatID CatName

0001 AAA

0002 BBB

0003 CCC

How to do this...

Regards/Guru

Accepted Solutions (0)

Answers (2)

Answers (2)

sid_sunny
Contributor
0 Kudos

Hi Kumara,

Try something like this

create a value node under this create two value attribute CatID and CatName and then use this code snippet

Collection data = new ArrayList();

int size = <size of your data>

for (int i = 0; i < size; i++) {

// instantiate the new context node element of type QuizData

IPublic<comp name>.I<value node name>Element Element =

wdContext.create<value node name>Element();

// set contained context value attributes

Element.setCatID(CatID value);

Element.setCatName(CatName value);

// add new context node element of the type value node to ArrayList

data.add(Element);

}

// Bind collection of context node elements to context value node

wdContext.node<value node name>().bind(data);

Do Reward points if it helps

Regards

Sid

former_member189631
Active Contributor
0 Kudos

Hi KumaraGuru,

If both are same data type u can use swapping technique.

Regards,

Ramganesan K.

Former Member
0 Kudos

Hi,

Can you brief on your reply please... how can I group multiple data i.e repetitive data as a single data...?

Regards/Guru