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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Why is my Canvas app d...
Power Apps
Unanswered

Why is my Canvas app displaying the wrong unique ID for the record being displayed?

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a simple Canvas app that includes a gallery that lists data from an Excel spreadsheet. The Edit form correctly displays the corresponding detailed data. Unfortunately, the gallery is displaying incorrect unique IDs for the items and I can't figure out why. Since the unique ID is incorrect, the resulting updates via the Edit form are updating the wrong row.

 

Gallery > Text = ThisItem.ID (same for other fields in gallery: ThisItem.ContactName, ThisItem.Title, etc.)
Gallery > OnSelect = 
ThisItem.ID Select(Parent) (same for other fields in gallery: ThisItem.ContactName, ThisItem.Title, etc.).


Data updated correctly before I configured the gallery > Items > SortByColumns(Filter(Contacts,StartsWith(ContactName,txtSearchBox.Text)),"ContactName",SortOrder.Ascending)


It's odd that all of the fields are configured similarly, however, the ID field pulls "1" for the first row in the spreadsheet, instead of "256" which is what it should be.

 

Help!

 

Thank you.

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous

    How are you assigning ID in your Excel table? 

  • Community Power Platform Member Profile Picture
    on at

    So I would have a unique ID to identify each row of data.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Yes. I understand why. How are you doing that? Excel tables don't have an index by default. 

  • Community Power Platform Member Profile Picture
    on at

    Defined a table and filled the ID column with:

     

    =ROW()-ROW(Contacts[#Headers])

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous

    PowerApps will not import calculated columns from Excel. I suggest that you move your data to SharePoint. 

  • Community Power Platform Member Profile Picture
    on at

    Weird because it appears to be pulling in the ID numbers but in numerical order of the SharePoint list not the alphabetical order of the Power BI list. 

     

    I just tried with a column filled with Series>Linear>Step Value = 1 so it's no longer a calculated volume but it displays the same value for some rows and nowhere near the correct ID number. 

     

    So, it that's the case, how do I define a unique ID or have the app update the correct row of data in the spreadsheet? 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous

    Set First(Sort(yourtable, ID, Descending)).ID+1 as the default formula for the ID field. This will work even if you exceed the data row limit. If you are using a form, put that in the Update property of the ID card and hide the card. 

  • Community Power Platform Member Profile Picture
    on at

    I configured the Text fx for the ID field to: First(Sort(Contacts.ID,SortOrder.Descending)).ID+1

     

    ssprague_0-1678646816387.png

     

    but it displays "2" for all the entries (below if from Edit form). 

     

    ssprague_1-1678646930751.png

    ssprague_2-1678647139298.png

     

    I can't find the "Update" property for the ID field in either the gallery or the Edit forms. 

     

    I really appreciate your help on this problem. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous

    There is a typo in your formula

    It should be

    First(Sort(Contacts, ID, SortOrder.Descending)).ID+1

  • Community Power Platform Member Profile Picture
    on at

    ssprague_0-1678651110409.png

    I copied and pasted your formula and this is the result (the "SortOrder." section is removed when I leave the field and reselect it).

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard