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 Platform Community / Forums / Power Apps / OnSelect taking me to ...
Power Apps
Unanswered

OnSelect taking me to wrong record

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

OnSelect is taking me to the wrong record in my form. Sometimes when I choose a record from the gallery it takes to the correct item but other times it takes me to a form of another item. It happens randomly. This is what I am using. 

Refresh('Submitted Requests');If(!IsBlank(LookUp('Submitted Requests', Title=(Gallery2_3.Selected.Title))),Navigate('CR Form',ScreenTransition.CoverRight,{locMode:FormMode.Edit,varRecord:LookUp('Submitted Requests', Title=(Gallery2_3.Selected.Title))}), Navigate('CR Form',ScreenTransition.CoverRight,{locMode:FormMode.New,varRecord:Blank()}))

 

Categories:
  • zmorek Profile Picture
    3,272 on at

    Are there multiple entries with the same Title in the data source or gallery? LookUp returns the first value that matches your formula; if there's multiple entries in the "Title" column that match "Gallery2_3.Selected.Title" it'll return whatever one it finds first. Consider using LookUp with an ID, else consider using Filter.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    No they are unique. ID doesnt work for me because it also patches to two other data sources and the ID numbers are off. I have three galleries the first is the one that is originally submitted to when the form is submitted then onsuccess patches to two others. The reason I use title is because the ID's are different from each data source. The only thing I can think of is to override that by using a lookup for the ID so that is forces the other two datasources to use them instead of assigning the number in sharepoint. @zmorek 

  • joeinmay Profile Picture
    205 on at

    Hello @Anonymous 

     

    @zmorek  is correct.

     

    Try this:

    On the select record of the Gallery OnSelect: Set(recID,ThisItem.ID); Navigate('CR Form')

    Next on the CR Form edit mode: Item Property: LookUp('Submitted Requests',ID=recID)

     

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard