Skip to main content
Community site session details

Community site session details

Session Id : A0url20HDxzXlocilNwMQt
Power Apps - Building Power Apps
Unanswered

Previous entries disappear after adding a new one.

Like (0) ShareShare
ReportReport
Posted on 18 May 2024 13:25:45 by 98

Hi, 
I've a gallery grid connected to SP list. 

Screenshot_66.png


When I try to add a new row, my previous row disappeared. 

Screenshot_68.pngScreenshot_67.png

Could you please help me, what the problem is?

OnSelect property on Add button:

ForAll(
 Sequence(NumberInput1.Value),
 Patch(
 TableList,
 Defaults(TableList),
 {
 Column1: "",
 Column2: "",
 Column3: "",
 GUID_Form: DataCardValue5.Text
 }
 )
);
Set(varReset, false);
Set(varReset, true);
  • Sohan Profile Picture
    151 on 18 May 2024 at 16:36:04
    Re: Previous entries disappear after adding a new one.

    Hello @xvzms,
    You may create a collection for that, like you have created a collection in the app on start, and then you may patch the value in this collection, and this collection will be used as a data source. I hope this will help you. Please accept as a solution if it's helpful to you. Thanks!
    App's on start collection:

    ClearCollect(
        colSheetData,
        {ID: 1}
    );


    Screen's on visible property collection:

    If('galTimeSheetNewEntry'.AllItemsCount = 0 , Patch(
        colSheetData,
        Defaults(colSheetData),
        {
            ID: If('galTimeSheetNewEntry'.AllItemsCount =  0 , 1, Last(colSheetData).ID + 1)
           
        }
    ));

    + or Add line button collection code:
    Patch(
        colSheetData,
        Defaults(colSheetData),
        {
            ID: If(
                'galTimeSheetNewEntry'.AllItemsCount = 0,
                1,
                Last(colSheetData).ID + 1
            )
        }
    );

    Delete or remove line collection:

     Remove(//If delete icon was selected
            colSheetData,
            LookUp(
                colSheetData,
                ID = galTimeSheetNewEntry.Selected.ID
            )
        );






  • Sohan Profile Picture
    151 on 18 May 2024 at 14:37:38
    Re: Previous entries disappear after adding a new one.

    Hello, @xvzms You may create a collection for that, like you have created a collection in the app on start, and then you may patch the value in this collection, and this collection will be used as a data source. I hope this will help you. Please accept it as a solution if it's helpful to you. Thanks!

    App On start's Collection:

    ClearCollect(
        colSheetData,
        {ID: 1}
    );
     
    Screen's on visible property:
    If('galTimeSheetNewEntry'.AllItemsCount = 0 , Patch(
        colSheetData,
        Defaults(colSheetData),
        {
            ID: If('galTimeSheetNewEntry'.AllItemsCount =  0 , 1, Last(colSheetData).ID + 1)
           
        }
    ))
     
    + Add button code:
    Patch(
        colSheetData,
        Defaults(colSheetData),
        {
            ID: If(
                'galTimeSheetNewEntry'.AllItemsCount = 0,
                1,
                Last(colSheetData).ID + 1
            )
        }
    );
     
    Remove line code:
     Remove(//If delete icon was selected
            colSheetData,
            LookUp(
                colSheetData,
                ID = galTimeSheetNewEntry.Selected.ID
            )
        );



Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete