Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • gstlouis Profile Picture
    on at
    Re: cannot refresh gallery fetching from data source

    @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

  • gstlouis Profile Picture
    on at
    Re: cannot refresh gallery fetching from data source

    @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
    Re: cannot refresh gallery fetching from data source

    @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')

  • charlessexton Profile Picture
    878 on at
    Re: cannot refresh gallery fetching from data source

    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 })

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,552 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard