web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Repeatable table

(0) ShareShare
ReportReport
Posted on by 272

I had successfully created a repeatable table a month ago and it was working fine.  Recently when I opened up the same application, the repeatable table behaved abnormal.  When the save button was clicked, it would created a duplicate of the saved row and an empty row.  See images below:

 

powerapps1.GIFpowerapps2.GIF

 

Any ideas why this is happening?  Very annoying.  Thanks!

Categories:
  • zaphod88 Profile Picture
    502 on at

    I think that your Gallery3.Selected is not working right, so it's taking Defaults(visitorCollection) instead and creating one item with the input texts. Can you try to replace Gallery3.Selected by
    LookUp(visitorCollection, ThisItem.ID = ID)? If you look into the collection in Files, does the first item have values or are they blank?

  • theisogunro Profile Picture
    272 on at

    @zaphod88 

    I get a squiggly line under the highlight shown below.  The ID's are not being recognized.  Also, no ID shows in the intellisense for ThisItem.  I know a comma is missing but even after adding it, the squiggly line still shows.

     

    theisogunro_0-1620135295781.png

     

  • zaphod88 Profile Picture
    502 on at

    Ah, you are creating this collection by scratch, not by a Sharepoint List? Yeah, of course then there is no ID column.
    What's about the remove button/trash can? Is this working as expected and what is its OnSelect formula?


    For testing purposes at least, you could try to add an ID by 

    ID: 1
    to your first Collect of visitorCollection where you are collecting the first empty record for the gallery.
    In the Save buttons OnSelect above please add
    ID: Last(visitorCollection).ID+1

  • theisogunro Profile Picture
    272 on at

    @zaphod88 This is what I have on my onSelect for the save button

     

    SubmitForm(Form1);Notify("Form has been successfully saved", NotificationType.Success);ResetForm(Form1);Navigate(Acknowledgement);ID:Last(visitorCollection).ID+1

     

    It still shows ID as not recognized.  Is it because it's not a column in my collection?

  • zaphod88 Profile Picture
    502 on at

    Yep, I guess that's the problem. Can you lookup the column names of visitorCollection in Files > Collections and see if an ID column is there? How and where do you create visitorCollection? 

    ID:Last(visitorCollection).ID+1 has to be added here (> your original post in this thread):

     

    zaphod88_0-1620189363548.png

     

     

  • theisogunro Profile Picture
    272 on at

    @zaphod88, apologies for the late response.  There is no ID column in my collection.  It gets created in the previous screen screen on the next button.  Here's the formula I use:

     

    ClearCollect(visitorCollection, {FirstName: "", LastName: "", MiddleInit: "", USCitizen: "", VIP: false, ElectronicDevice: false});

    Navigate('Vistor Information', ScreenTransition.None)

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @zaphod88 

    Be careful about using Last() in setting the ID.  You will eventually run into a problem with delegation.  Better choice is First(Sort(SPlist, ID, Descending)).ID+1.  Although First() may also not be delegatable, it won't matter because it will always chose the last ID since Sort() is delegatable. 

  • Verified answer
    zaphod88 Profile Picture
    502 on at

    Please try to add an ID to this ClearCollect like this:

    ClearCollect(visitorCollection, {FirstName: "", LastName: "", MiddleInit: "", USCitizen: "", VIP: false, ElectronicDevice: false, ID: 1});

    In the Collect on your save button, add ID:Last(visitorCollection).ID+1 to the collected fields. Then try to patch by lookup like in my first post above.

  • theisogunro Profile Picture
    272 on at

    It's a collection and not a list.

  • theisogunro Profile Picture
    272 on at

    Thanks @zaphod88!  That worked.  Thanks for hanging in there with me.  So, I must always create an ID for my collections and increment using the method you shared from this thread?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard