Skip to content

Power Apps

Insert A New Row Into A Collection

Insert A New Row Into A Collection Input collection: myTestScores31a FullName Age TestScore David Jones 32 78 Anne Lisbon 45 92 Penlope Parra 26 56 Input rec...

Matthew Devaney
Published
Reading time
1 min read

Before you start

Is this guide for you?

Best entry point
Power Apps
Time investment
1 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/powerapps-collections-cookbook/insert-a-new-row-into-a-collection-2/. Author: Matthew Devaney.

Insert A New Row Into A Collection Input collection: myTestScores31a FullName Age TestScore David Jones 32 78 Anne Lisbon 45 92 Penlope Parra 26 56 Input record: myTestScores31b FullName Age TestScore Harold Reimer 50 65 Output collection: mySolution3 1 FullName Age TestScore David Jones 32 78 Anne Lisbon 45 92 Penlope Parra 26 56 Harold Reimer 50 65 Solution code: //Create a collection

ClearCollect(myTestScores31a, { FullName : "David Jones" , Age : 32 , TestScore : 78 }, { FullName : "Anne Lisbon" , Age : 45 , TestScore : 92 }, { FullName : "Penelope Parra" , Age : 26 , TestScore : 56 } ); //Create a Row

Set ( myTestScores31b, { FullName : "Harold Reimer" , Age : 50 , TestScore : 65 } ); //Insert a new row into collection code

ClearCollect(mySolution31,myTestScores31a); Collect(mySolution31,myTestScores31b); //Alternate solution

ClearCollect(mySolution31,myTestScores31a); Patch( mySolution31, Defaults(mySolution31), { FullName : "Harold Reimer" , Age : 50 , TestScore : 65 } ) Code language: JavaScript ( javascript )

Share this

Tagged

Collections · Power Apps

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →