How can I copy entire pxResults to Page List in one step

Hello,

I think this is a beginner question. I simply want to copy the entire list from tempPage.pxResults to MyList (Page List property in Work class). Please assume pxResults and MyList are the same class. I usually loop over tempPage.pxResults and do Property-Set all the elements, shown as below.

I do not want to append list to MyList as it may get double, so I also remove MyList property before the loop step. However I am feeling this code is very inefficient and I am wondering if it is possible to just want MyList to be overwritten by tempPage.pxResults in a single step. I tried Page-Copy from tempPage.pxResults to MyList but it did not let me save. Is such thing possible? I do not need to loop…

Regards,

@CloeW938 You can use a data transfrom here,

In data transfrom you have an option called Append (since you have both classes same) to copy tmpPage.pxResults into original page.

@BATTINIRAMESH

Creating another rule is not simple. Can’t we do this in an activity? This is a very simple operation..

Now I just simply did Property-Set tempPage.pxResults to MyList and it seems to be working for now. Is this a valid approach?

@CloeW938 simply do property-set

pagelist property on property name and page.pxResults the other side .
this work when both properties are of same class

@SatishS84

Thanks, I did not know such simple method works! (now I wonder why many developers use loop over the list to copy one by one…)

@CloeW938 It is the simpler way to copy directly from page list to page list.

But We can do it using Data Transform, Activity is not a better approch. (Same thing in data Transform )

Append and Map to : Target-Page list(1) - For each page in(Relation)-Source :Page list(2)

In Child Steps directly set wt ever u require