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 / Inconsistent record re...
Power Apps
Answered

Inconsistent record reference when referencing from Gallery to edit screen

(0) ShareShare
ReportReport
Posted on by 140

Hi All,

 

I sometime faced inconsistent record reference in my "Edit details" screen (not using the default form function to generate form) when i select the records from the Gallery Screen and then from there navigate to the "Edit Details screen".

 

To retrieve the records, I use the Set(Record, Gallery.Selected) formula in the "On-Select' of the Gallery control and then in the Edit Details screen, I display the data in the various controls by setting the Items to the Record and its associated values. This works most of the time except sometime when i create new item or when i repetitively used the app to do editing of the details of each of the records. I have to reselect a few time before the right reference records is passed into the edit screen. Would anyone be able to advise what went wrong?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Boon-1 ,

    I will give you an alternative (assuming you are using SharePoint) as I have had issues also presenting an edit screen with a Variable for the Item (which is a copy of the record, rather than the record itself)

    OnSelect of the Gallery

    Set(
     vIDNo, 
     Gallery.Selected.ID
    )

    Item of the Form

    Lookup(
     YourListName,
     ID=vIDNo
    )

     You then have the actual record on the form. Try this and see if it makes a difference.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-xida-msft Profile Picture
    on at

    Hi @Boon-1 ,

    Do you mean that the Display form could not display correct record selected from your Gallery sometimes?

     

    Please consider take a try with the following workaround:

    Set the OnSelect property of the ">" icon in your Gallery to following:

    Navigate(DetailScreen, ScreenTransition.Fade, {IdentifierValue: ThisItem.PrimaryColumn})

     

    Within your Detail Screen, set the Item property of the Display form to following:

    LookUp('Your Data Source', PrimaryColumn = IdentifierValue)

    Note: The PrimaryColumn represents the Primary Key column in your data source, which could identify one record uniquely. If your data source is a SP List, the Primary Key column may be "ID".

     

    Please try above solution, check if the issue is solved.

     

    Best regards,

  • Boon-1 Profile Picture
    140 on at

    Hi Warren,

     

    Thanks for the swift response. Let me go try it out and see if it works. By the way, would it matter if i set the formula as such instead of setting the ID reference number to the Record, global variable?

     

    In the Gallery,

    Set(Record,Gallery2.Selected)

    In my edit form

    LookUp(MyList,ID=Record.ID,Approver)

  • v-xida-msft Profile Picture
    on at

    Hi @Boon-1 ,

    Have you taken a try with the solution I provided above? Is it helpful in your scenario?

     

    Based on the issue that you mentioned, you could consider pass the PrimaryKeyColumn (e.g. ID column value of a SP List) value from your Gallery screen to your Detail screen, when execute the Navigate function. Then within your Detail screen, you could reference the passed context variable value directly within your Display form Item property.

     

    Please try the solution I provided above, then check if the issue is solved.

     

    Best regards,

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Boon-1 

    I don't quire understand your question - are you asking if the global variable could be the entire record rather than just its ID?

     

     

  • Boon-1 Profile Picture
    140 on at

    Hi Warren,

     

    I have implemented your suggestion and it work fine initially. However, when i try to filter the gallery using a search box, and try to try on other items in the gallery, sometime the inconsistency reference in the edit form happened again. Not sure what went wrong. 

     

     

  • Boon-1 Profile Picture
    140 on at

    Hi Dai, 

     

    Thanks for your help. I try implementing your suggestion but couldn't get it working as the IdentifierValue does not appear globally when embedded in the arrow button of the gallery.

  • Boon-1 Profile Picture
    140 on at

    Yes indeed. But nonetheless, i went to implement your suggestion instead.

  • Boon-1 Profile Picture
    140 on at

    Hi Kris,

     

    I did as you have describe but following Warren approach currently. However, the reference issues still occur especially if when i filter the gallery and click on the gallery but it return the ID reference of previously selected items.  

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Boon-1 ,

    Who are you responding to here?

    Please tag whoever you want to continue with as three-way conversations just confuse everyone.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard