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.

The gallery should be populated like this:

I used the Refresh() function like this Refresh('viewDocumentList').
And this
is the result I get back when I look at the 'viewDocumentList' datasource.

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