How can I copy data from on collection to another?

I'm trying to copy values from one collection to another.

for example :

Assessment Criteria collection has two fields :

  1. Criteria.
  2. Rating.

Assessment Form Collection has four fields:

  • these are the fields that i need to copy from the "Assessment Criteria collection".

  1. Criteria
  2. Rating

  • the other two fields remain blank.

Best Answer

Dear Ahmad,

In order to copy values from one collection to another, please create a script with these characteristics:

Create a first loop to get values. You can access to those registers. An example is of it:

EntTableList= CEntityManager.GetEntity("CollectionA").GetEntityList("", "", "", "");

for(i=0; i< EntTableList.Length; i++)


//obtain the primary key of the register

var key=EntTableList.SurrogateKeyValue;

// Rest of the script

}Then, into of this loop (Rest of the script), add registers to the new collection. You can use newCollection function:

Best Regards


Dear Ahmad,

Yes, on this forum, we cannot use [ i ]. ( "i"). Please try removing .GetEntityList("", "", "", "") from the fuction.

Another way is with the iterate Over Xpath fuction:

Best Regards


Dear Juan Zuluaga,

I'm using iterate over xpath with "Predefinedquestion" as an object variable, the copying process seems to work but i'm receiving wrong output.

this is the code :

criteria =Predefinedquestion.getXPath("Criteria");

rating = Predefinedquestion.getXPath("Rating");

var Newrecord = Me.newCollectionItem("Assessement.ICTPlans");


CHelper.trace("Predefinedquestion", "Criteria = " + criteria);


CHelper.trace("Predefinedquestion", "Rating = " + rating) ;

I'm copying two rows of data from one collection to another, the trace file shows that the rows are in the correct order but the results i'm receiving in the work portal show the opposite. it assigns the values in the last record to all the values in the collection.I've attached the trace file and a screen shot of the work portal



Dear Ahmad,

you will find all the information you need in the following link

Also try to put just the name of the column of the record you are going to add, so it would be like this


And that should work.