I have an application in power apps

in app.onstart i wrote a code
basically that code has a variable and it will count number of rows in sharepoint list and store that result in a variable which i created
and later i used that variable inside in application using some condition
so whenever i run my application, the variable which i created in app.onstart doesnt get updated unless i click manually
app.Run onstart.