web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to count screen vi...
Power Apps
Answered

how to count screen visible

(0) ShareShare
ReportReport
Posted on by

i have a screen ,when ever user navigate to that screen ,on top of it ,it should display number of view count,

any idea how to do this?

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,484 on at

    Hey @venky232 

     

    You can make a global variable, and whenever a button is pressed to navigate to that screen, you can increase the value of it by one. Or if there is a back button too, you can add the global variable increment in that too. 

     

    You want the variable to be for a single user, or it should keep the overall count. Like 10 people visited the screen on Day 1. Then 10, and on Day 2 10 more, so 20 now. 

    If its the second case, then you will have to save the value in a Collection or a database. From where it will fetch the value after the app is closed. 

  • venky232 Profile Picture
    on at

    yes mine is 2nd case.

    how to write the code?

  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on at

    Hey @venky232 

     

    On Screen 1 of the app I have a button, that is Navigating me to Screen 21. Screen 22 is the one I am keeping track of. 

    So, onSelect the button I wrote the formula: 

    Navigate(Screen21);Set(ScreenCount,Value(First(L1).C1))

    Where L1 is my List Name and C1 is the column that will keep track of count for the screen. 

     

    Sundeep_Malik_0-1670405568442.png

    Now I will click on the button and Navigate to Screen 22. 

    On the OnSelect Property:

    Navigate(Screen22);Set(ScreenCount,ScreenCount+1);Patch(L1,LookUp(L1,Title="1"),{C1:ScreenCount})

    This will increase the variable by 1 and also patch the value in sharepoint. 

    Sundeep_Malik_1-1670405889688.png

    Then on Next Screen I have done this:

    On right side I have taken a text label and passed the ScreenCount Variable in it. 

    Sundeep_Malik_2-1670405990748.png

    Then on Screen 23, I have used a back button to go back to Screen 22. This will also increase the count by 1 and also save the value in database.

    Sundeep_Malik_3-1670406096417.png

     

     

    I hope this will help. 🙂

     

  • venky232 Profile Picture
    on at

    @Sundeep_Malik 

    here instead of button to navigate to screen22, i inserted code in gallery on select  & on next detail screen ,on visible properties i added below code 

    Set(ScreenCount,ScreenCount+1);Patch(L1,LookUp(L1,Title=Gallery6.Selected),{C1:ScreenCount})

    but result count showing same for all records 

    i inserted label in gallery and mention as ThisItem.C1

  • Sundeep_Malik Profile Picture
    6,484 on at

    @venky232 

     

    I hope you are using your columns and list? L1 was my sharepoint list and C1 was the column I was taking value from. I hope you are using yours only. Rest everything looks fine. 

    Probably dont add it on on visible, add it on some kind of button.

  • venky232 Profile Picture
    on at

    yes i used my table name & cloumn name mentioned in my database excel, i want to record screen visible count, i dont have button to record it.when ever user visit screen it should display Number views on screen

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 402

#2
WarrenBelz Profile Picture

WarrenBelz 380 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 293 Super User 2025 Season 2

Last 30 days Overall leaderboard