Introduction
We often see in many of the sites that the total page view count is shown. I have come across one of the use cases where I wanted to show how many times that page was visited by any user uniquely.
Scenario
We will see 1 scenario in the article.
Objective
The objective of this requirement is very demanding as it is often seen total number of views on the page and how many people provided their views on any article. We will keep patching the latest count to a list row and keep showing on the power apps.
Step 1. The list structure would look like below.
The list structure could be designed as per our needs. Here for a demo, I have created 2 different lists and shown the data with its list structure.
Article list structure
![]()
Article list content
![]()
The second list will save data from power apps and the list structure looks like below.
![]()
Step 2. Design screen and form as per requirement.
Below screenshot shows all the articles which are entered, on click of articles, we can see the details of the article and all the views that we got on that article. To show all articles, I have taken gallery control.
![]()
Below is the display form, which shows the variable View value. Variable View value shows gallery selected item details.
![]()
Step 3. Save Logged in User in a Global variable.
We keep logged In user details in a global variable for performance improvement. Otherwise User().Email could directly be used where ever required.
![]()
Step 4. Add list DataSource from SharePoint.
Add PageViewCountItemWise List from SharePoint as DataSource.
So that the patch function can use this datasource to store the views and show it back on the PowerApp.
![]()
Step 5. Patch the count on OnVisible Property of page.Show unique total views on page on powerapps or how many and who all people have seen/visited the page.
We will patch on OnVisible property. If its first time entry then patch function will create a new record other wise it will not do anything because we are only showing uniquely visited people list.
![]()
Note. OnVisible property only runs after the screen is loaded. We have to manually load the screen for the first time. Go to any other screen and come back to this screen to run the OnVisible property.

Join the conversation! Your thoughts help the community grow.