I am trying to build a power app grid like gallery where user will add a data. i have created a collection using defaults property and used it in a gallery items property.

in onchange of gallery inputs i am selecting load button.

in add button,
Set(varnewrecordscaff,Defaults('Scaffofing Calculator Results'));
Set(varnumberscaff,1000000)

but if i select add button two rows getting added once with id and other with no ID

HOW TO SOLVE IT