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 / Help Fixing Gallery Da...
Power Apps
Unanswered

Help Fixing Gallery Data Problems (Edit or View screens show the wrong data, etc)

(0) ShareShare
ReportReport
Posted on by 3,347

Description of problem: 

  1. When you go into an edit form for the FIRST time when you run an app, some of the data changes to what is in the FIRST item in the gallery.
  2. When you go into an edit form, any time (not just the first time), some pulldown menus change themselves to the FIRST item in the list for the pulldown.
  3. Other random incorrect data situations.  I have not defined them as specifically as those issues as descriped in 1 & 2.

 

Fixing issue 1 & 2 can be accomplished by using this statement when you select the gallery item.

set(GalleryItem,Gallery.Selected) 

Then, in the edit form, you put GalleryItem in the Item control.

 

This seems to pull in the correct data every time.  HOWEVER... how do you write the data back to the sharepoint item?

Categories:
I have the same question (0)
  • martinav Profile Picture
    3,347 on at

    I have just found... that even the set() method is not foolproof.  While it seems to work for most fields.  There is one very simple text field that is pulling data from item 1 in the gallery.  Not only does it do it... it does it EVERY time!  

     

    Thus, set() is not a solution!

     

    This is a SERIOUS PROBLEM.  It is fundamental problem, and this is risking my business!!

  • xzDan Profile Picture
    350 on at

    (Not offering any solution here)


    Are you using SharePoint? I did look yesterday at the default edit form, and i recall the Items being set to the First() of the datasource, so this must be where it is pulling the first entry in, and perhaps failing if it should not be doing so?

  • martinav Profile Picture
    3,347 on at

    @xzDan 

     

    This is sharepoint, yes.  No, it does not pull in the first item every time.  The items is set to Gallery.Selected.  This app is months old, and was working great up until January.  Its been flakey every since!!

  • martinav Profile Picture
    3,347 on at

    Update on my switch to using my Set() variable to Items....

     

    The field (datacard) that was pulling in the first item every time... it was unlocked and converted to a Custom.  I added that field back into the form.  It worked.  Despite all of the Data controls being IDENTICAL to that of the new one, It was not working properly.  I deleted that datacard, and the new one is working properly.

     

    I now at least have something to go on if a datacard is not working properly... check if it is locked and unedited.  Apparently they are having problems, even if you do not change the Data controls.

     

    I proceed....

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @martinav ,

    Have you solved your problem?

    Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.

    Please consider take a try to re-create a new app based on your SP list data source, and turn off/disable the "mproved app rendering (final validation)" option within Advanced settings of App settings of your app, then check if the issue is solved.

     

    In addition, I also agree with your though almost. I think saving selected item in your Gallery into a variable would also be a better solution to achieve your needs.

    If you want to write changes back to corresponding item in your SP list, you could consider achieve your needs using Patch function instead of SubmitForm function. I have made a test on my side, please take a try with the following workaround:

    Set the OnSelect property of the Gallery to following:

    set(GalleryItem, Gallery.Selected)

    Set the Item property of the Edit form (Form1) to following:

    GalleryItem

    Set the OnSelect property of the "Edit" icon (click it to edit an item) to following:

    Refresh('YourSPList');
    EditForm(Form1);
    Navigate(EditScreen, ScreenTransition.None);

    Set the OnSelect property of the "Submit" button to following:

    Patch(
    'YourSPList',
    GalleryItem,
    Form1.Updates
    )

    If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

  • martinav Profile Picture
    3,347 on at

    @v-xida-msft ,

     

    My app is currently set with the option as you stated (improved rendering is "off").  I did that some time ago from someone else's reccomendation.  That did not resolve the issue.  Plus, this started happening in ALL of my apps that hve galleries for editing.  They all started showing the problem mid-january.

     

    Using set() and putting the variable into the Item control of the edit form seems to work fine for brining in the correct data, as well as writing back to the sharepoint list item.  I was surprised it did.  I am guessing it is because this particular function was smart enough to use the ".id" value for the item value in the set() variable.  

     

    As I keep stating...  set() does work, but Gallery.Selected fundamentally is broken, and should work fine.  It worked fine for months and quit working correctly in Mid-January in all my apps.  I am calling this a "work-around" to avoid a Powerapps problem, not a solution.

     

    Thank you.

  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @martinav wrote:

     

    Fixing issue 1 & 2 can be accomplished by using this statement when you select the gallery item.

    set(GalleryItem,Gallery.Selected) 

    Then, in the edit form, you put GalleryItem in the Item control.

     

    This seems to pull in the correct data every time.  HOWEVER... how do you write the data back to the sharepoint item?


    I am not understanding the issue you're experiencing. Are you using SubmitForm(FornName) to save the form data? If so, can you describe what is happening?

     

    A screenshot and the text of the error you're getting would be very helpful. And as this relates to the flow of data in the app, it would be helpful to include a session id, but there's not much information to go on here.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard