5
Views
3
Comments
Copying one record list to another
Question
how do you copy record list X onto the end of an existing record list Y?

Note:  record list Y contains existing records, and should not be overwritten by record list X.

One solution, is to use "ListAppend" function and do a loop, copying one record at a time from record list X into record list Y. But how would you get the max record count of record list X? (ie so that it could be used to perform a loop)
2017-10-02 14-22-21
Paulo Tavares
Staff
Hi Robert,

If you have a Record List, you can use a For Each loop, and copy the Current record from list X to Y. I'm not sure why you would need the count of record list X - you do not need to access each Record List item by its index.

Also, if I am not mistaken, you can get the count of a Record List by checking its Length property.

Regards,

Paulo Tavares
2020-09-14 17-53-31
Gonçalo Gaiolas
Robert,

Take a look at ListUtils, I think it might have what you need - https://www.outsystems.com/NetworkSolutions/ProjectDetail.aspx?ProjectId=162

Best regards,
Goncalo
2019-10-09 06-46-56
Daniel Lourenço
Staff
Hi Robert,

I see that you already have your answers. I would just like to add that  it might also be interesting to read the Record List data type and actions description and the Record List Runtime Properties explanation .

Another subject that can be useful is how you can do direct indexing in Record Lists using and expressions like MyList[index].

Kind Regards,

Daniel Lourenço
OutSystems
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.