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 / cannot refresh gallery...
Power Apps
Unanswered

cannot refresh gallery fetching from data source

(0) ShareShare
ReportReport
Posted on by

I have this Gallery and a tab sitting on top of the gallery.  This tab has a file upload control that I stole from a form in another screen.  I did this because I am using the file upload control function to upload a file and trigger a flow in automate that uploads the file with meta to a sharepoint directory.

 

This is in my file control OnAddFile:
fileUpload.Run(Project.ID,{file:{contentBytes: Last(DataCardValue89_1.Attachments).Value, name: Last(DataCardValue89_1.Attachments).Name}});
Refresh('PSI - DIRECTORY');
Reset(DataCardValue89_1);

The file upload works fine, but the gallery does not refresh to show the new file.  However, If I add another file the same way right after this, it will show the first uploaded file and not the current file I am trying to upload.  The same behavior keeps going every time I upload a file, the previous one shows up.  So it's not refreshing real time. 

 

The gallery is fetching directly from data source with this:
Filter('PSI - DIRECTORY', fk_projects = Project.ID)

I've read somewhere someone fixed this by doing the refresh and reset of the form.  But this isn't a form since I just took the file upload control only and did the functionality with automate.

Any ideas?
 

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

    Your Power Automate flow might not have finished by the time you're refreshing the data source. If you assigned the result of the flow to a variable, it will force it to complete before processing the next bit of code.

     

    UpdateContext({ discard: fileUpload.Run(Project.ID,{file:{contentBytes: Last(DataCardValue89_1.Attachments).Value })
  • gstlouis Profile Picture
    on at

    @charlessexton thanks for the reply.  I didn't think of it that way.  It did not look to have worked however.

    here is what I changed according to your comments
    UpdateContext({ discard: fileUpload.Run(Project.ID,{file:{contentBytes: Last(DataCardValue89_1.Attachments).Value, name: Last(DataCardValue89_1.Attachments).Name}}) });
    Reset(DataCardValue89_1);
    Refresh('PSI - DIRECTORY')

  • gstlouis Profile Picture
    on at

    @charlessexton 
    I also added an extra button with the following to click after file upload and still not working 

    Reset(DataCardValue89_1);
    Refresh('PSI - DIRECTORY')

  • gstlouis Profile Picture
    on at

    @charlessexton 
    wait, sorry the button thing did work.  So I'm thinking you are correct, it just needs a little time.  But adding automate to a var didn't do the trick

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard