Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • venky232 Profile Picture
    on at
    Re: how to count screen visible

    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

  • Sundeep_Malik Profile Picture
    6,480 on at
    Re: how to count screen visible

    @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
    Re: how to count screen visible

    @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

  • Verified answer
    Sundeep_Malik Profile Picture
    6,480 on at
    Re: how to count screen visible

    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
    Re: how to count screen visible

    yes mine is 2nd case.

    how to write the code?

  • Sundeep_Malik Profile Picture
    6,480 on at
    Re: how to count screen visible

    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. 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard