Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Previous entries disappear after adding a new one.

(0) ShareShare
ReportReport
Posted on 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
    Sohan 142 on at
    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
    Sohan 142 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard