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?
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
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.
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
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.
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.
Then on Next Screen I have done this:
On right side I have taken a text label and passed the ScreenCount Variable in it.
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.
I hope this will help. 🙂
yes mine is 2nd case.
how to write the code?
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.
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional