Introduction
The total page view count is frequently displayed on numerous websites. In one of my use cases, I needed to display the unique number of times each user viewed the page.
Scenario
We will see 1 scenario in the article.
Objective
This requirement's goal is extremely difficult because it frequently displays the overall number of views on the page as well as the number of users who have left comments on any given article. We'll continue to patch the most recent count to a list row and display it on the powerapps.
Step 1. The list structure would look like below.
A list structure might be created based on our requirements. I've made two distinct lists here for the experiment, and the data is displayed along 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.
The snapshot below displays every article that has been submitted. By selecting an item, we can check its details as well as the number of views it has received. I've taken control of the gallery so that it displays all items.

Below is the display form which shows the variable View value. Variable View value shows gallery-selected item details.

Step 3. Save the Logged User in a Global variable.
We keep logged-in user details in a global variable for performance improvement. Otherwise User(). The email could directly be used wherever required.

Step 4. Add a list of DataSource from SharePoint.
Add PageViewCountItemWise List from SharePoint as DataSource.
So the patch function can use this data source to store the views and show it back on the PowerApp.

Step 5. Adjust the page's OnVisible Property count. Display the total number of unique views for a page on PowerApps, or the number and identity of visitors.
We will patch on OnVisible property. If it's first a first-time entry then the patch function will create a new record other it will not do anything because we are only showing a uniquely visited people list.

NOTE. After the screen loads, the OnVisible attribute activates. For the first time, we have to manually load the screen. To use the OnVisible attribute, navigate to any other screen and then return to this one.














Join the conversation! Your thoughts help the community grow.