Re: Onvisible Not Firing

Please make sure that you have fired the OnVisible property of the corresponding screen already. Please take a try to select other screen of your app, then back to the target screen (whose OnVisible property set to the formula you provided), check if the count variable is populated with values.

In addition, as an alternative solution, I think a Timer control could achieve your needs. Please consider take a try to add a Timer control within your target screen, set the Duration property to following:

1000

Set AutoStart property and Repeat property to following:

true

Set the OnTimerEnd property to following:

Set(count, CountA(Filter('[dbo].[TableName]',ID=selected.ID).Name))

Set the Visible property of the Timercontrol to following:

false

then check if the count variable is populated with proper value.

If the issue still exists, please consider take a try to re-create a new app based on your data source, then try your formula again, check if the issue is solved.

Best regards,

Community Support Team _ Kris DaiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Onvisible Not Firing

Are you sure the statement is not being executed? You have an extra set or parenthesis, but that should not be a problem.

Are there other statements in your OnVisible action? Any red X's?

I would go to another screen then come back to it (to make sure the OnVisible happens) and then look at your variables (View->Variables-Global) and see if it is there. If so, it is happening, perhaps just not returning what you think/expect.

Hope this helps some.

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Onvisible Not Firing

Could you please share a bit more about the issue within your app (the screenshot you provided is not your issue)?

Do you mean that the count global variable could not store the count value which your CountA() formula returns?

Further, could you please share a bit more about the selected.ID that you mentioned?

The OnVisible property of a screen would only be fired when the corresponding screen is visible. Based on the formula that you mentioned, I could not find any syntax error with it.

Please consider take a try to add a Label control within your screen, then set the Text property to following:

CountA(Filter('[dbo].[TableName]',ID = selected.ID).Name)

then check if the Label control could display the count number. If the Label control could not display count number, I think this issue is related to your CountA() formula itself rather than OnVisible property.

Please check if you have typed proper filter condition within your Filter formula. In addition, please also consider take a try with the following formula:

Re: Onvisible Not Firing

Please make sure that you have fired the OnVisible property of the corresponding screen already. Please take a try to select other screen of your app, then back to the target screen (whose OnVisible property set to the formula you provided), check if the count variable is populated with values.

In addition, as an alternative solution, I think a Timer control could achieve your needs. Please consider take a try to add a Timer control within your target screen, set the Duration property to following:

1000

Set AutoStart property and Repeat property to following:

true

Set the OnTimerEnd property to following:

Set(count, CountA(Filter('[dbo].[TableName]',ID=selected.ID).Name))

Set the Visible property of the Timercontrol to following:

false

then check if the count variable is populated with proper value.

If the issue still exists, please consider take a try to re-create a new app based on your data source, then try your formula again, check if the issue is solved.

Best regards,

Community Support Team _ Kris DaiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Onvisible Not Firing

@prajyotso where is "selected.ID" coming from? Is this actually having a value? If not, then you will have an empty filter and thus a count that is not what you expect.

I would first check to see where you are getting the "selected" from. I assume this is another variable. If so, does it have a value OnVisible?

The fact that you have a label.text that shows a value and a Global Variable that is set OnVisible and doesn't have a value - and yet have the same formula, makes me wonder what you have in the selected variable..

To test - try to set the formula to a known ID (i.e. Set(count,CountA(Filter('[dbo].[TableName]',ID=10).Name)) and see if that returns at least a count of 1. If so, then the selected.ID is the culprit to look at.

_____________________________________________________________________________________Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Re: Onvisible Not Firing

@v-xida-msft Kris! You're awesome! I was coming to the forum to report a bug: OnVisible not firing... Its already been reported and you've got a solution!

I arrived at the same solution although in my case, I have to set the timer duration to 1500ms for the OnVisible functions to fire. 1000ms was not enough. @MicrosoftPowerAppsTeam: Please consider this a bug that needs to be fixed. Thank you