--- title: "Updating an Array with new records in App behavior" slug: "updating-an-array-with-new-records-in-app-behavior" updated: 2024-01-24T13:51:05Z published: 2024-01-24T13:51:06Z canonical: "help.pillir.io/updating-an-array-with-new-records-in-app-behavior" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Updating an Array with New Records: Recommended Logic Blocks I need to update an array with new records through a behavior. What are the recommended logic blocks to be used for this requirement? There are two blocks that can be used to update an array with new records. However, one block is more strongly recommended, and the reasons for preferring it over the other are explained below. ## Variable component > Set block ![setblock](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/setblock.png) In the above image, Enrollist is an array where a new record is required to be added. **How it Works:** The **Set** block inserts the record directly into the Enrollist array. This method is time-efficient and hence **recommended** to be used for all scenarios where array needs to be updated. ## List component > in list block ![inlist-insertblock](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/inlist-insertblock.png) In the above image, Enrollist is an array where a new record is required to be added. **How it works:** - The block takes a copy of the existing array. - It adds the new object into the copy. - Finally, it assigns the modified copy back to the original array. The drawback of this method is that it increases the process time, especially when dealing with large datasets. NoteWhile this method achieves the desired result, it is **not recommended** to be used for large arrays due to the increased processing time.