cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Boon-1
Helper III
Helper III

Inconsistent record reference when referencing from Gallery to edit screen

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?

17 REPLIES 17

@Boon-1 ,

Who are you responding to here?

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

Hi @WarrenBelz 

 

Apologies for the confusion. This is in response to your response.

Hi @WarrenBelz 

 

Repost it to minimise the confusion. I implemented your suggestion and it work fine for the first few time. However, the reference issues still occur after a few attempts to test out the solution, especially when i filter the gallery and click on the gallery and then it return the ID reference of previously selected items. I wonder if this is a Power Apps issues instead of formula issues.   

Hi @Boon-1 ,

I have made a test on my side, and don't have the issue that you mentioned. I think the solution provided by @WarrenBelz is proper.

 

Set the OnSelect property of Gallery to following:

Navigate(DetailScreen, ScreenTransition.None, {ItemID: Gallery1.Selected.ID})

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

Select(Parent)

 

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

LookUp('Your SP List', ID = ItemID)

 

If the issue still exists, please re-generate a new app based on your SP List data source, then try above solution again, check if the issue is fixed.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft 

 

Many thanks for your help. Since you mentioned Warren solution is proper, i will adopt his solution instead as there will be many other items within my apps that is linked to the record ID and changing all of them will be a nightmare scenario. When you say create, a new app, does it mean i have to start everything from scratch or can i save as another version to do ? Re-generate the app is too painful for me to proceed and i hesitate to do that

Hi @Boon-1 ,

You could also consider take a try with above solution I provided, check if it could help in your scenario.

 

You could consider take a try to copy your canvas app as another name, then try the copied app, check if same issue still exists. If the issue still exists, please consider submit an assisted support ticket for further help through the following link:

https://powerapps.microsoft.com/en-us/support/pro

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Boon-1 ,

I am not sure where we are here - I have been offline for an hour or so.

I will go back to my original post

OnSelect of the Gallery

Set(
   vIDNo, 
   Gallery.Selected.ID
)

Item of the Form

Lookup(
   YourListName,
   ID=vIDNo
)

This does two things:-

  • Presents the actual record to the form, so SubmitForm is generally never an issue.
  • Makes the ID number of the current record available as a Variable for other references including lookups (as you have mentioned) - I do this on every app I write.

Are there any other issues you have now?

 

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.

View solution in original post

Hi @v-xida-msft 

 

Okay let me explore further. Thank you !

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (57,604)