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 / Using Refresh() on a S...
Power Apps
Answered

Using Refresh() on a SQL View does not return data correctly

(0) ShareShare
ReportReport
Posted on by 21

 

I have a gallery which displays a list of documents.

This gallery's datasource is a SQL Server view which displays 

document information stored in a SQL Server database.

 

I want to re-populate the gallery with the newly inserted record data.

 

I can successfully upload documents using my app.

The problem is the newly uploaded document info does not appear in the gallery list.

And half the time no data displays in the gallery.

sdfsdfsfsdfsfsd_1-1710054967229.png

The gallery should be populated like this:

sdfsdfsfsdfsfsd_2-1710055191367.png

 

I used the Refresh() function like this Refresh('viewDocumentList').

And this 

is the result I get back when I look at the 'viewDocumentList' datasource.

 

sdfsdfsfsdfsfsd_0-1710053915125.png

It seems as if the Refresh() function is not returning the data correctly.

If I leave this screen, go to another screeen, and return to this screen the data

in the gallery displays correctly.

 

Does someone know how to have the Refresh() function return 

 

 

 

 

Categories:
  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @sdfsdfsfsdfsfsd, try turning off this preview feature:

    AhmedSalih_0-1710078053592.png

     


     

    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

     

  • LS-04091539-0 Profile Picture
    21 on at

    In addition to Ahmed's solution of turning off the Explicit column selection feature, I found another solution buried in the Microsoft documentation.

     

    It says:

    "Occasionally, when an app pulls data in through collections, the original lineage or source of a column can be lost. We don't know if it’s being used and we drop it using ECS. You can usually force ECS to work for a missing column by using the PowerFx expression ShowColumns after a collection reference or by using it in a control."

     

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/efficient-calculations

     

    So I put my collection in the ShowColumns() function without turning off the Explicit column selection feature and the correct data was returned.

     

  • LS-04091539-0 Profile Picture
    21 on at

    Thank you very much Ahmed for your solution to this problem.  I spent a week and a half beating my head over this one before reading your solution.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard