cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pal95
Helper IV
Helper IV

Canvas Scrollable Data Card scrolled to the bottom when entering the screen (I want it to always start from top)

Hi,

Is there any way to force Data Card to start from the top when entering the screen?

I have a list of banks, like Bank 1, Bank 2, Bank 3, and each element of that list lead to the same screen, just with a different Bank value. After the user completes the survey in Bank 1 and he wants to go to Bank 2, the Data Card is already scrolled down, and it is very inconvenient.

Hi,

Is there any way to force Data Card to start from the top when entering the screen?

I have a list of banks, like Bank 1, Bank 2, Bank 3, and each element of that list lead to the same screen, just with a different Bank value. After the user completes the survey in Bank 1 and he wants to go to Bank 2, the Data Card is already scrolled down, and it is very inconvenient.

Bank Selection then goes to another screen:

pal95_0-1623668762657.png

 

Goes to this:

pal95_1-1623668859205.png


As you can see, Bank 2 is saving the position of the scrollable canvas from Bank 1, and I would like to avoid it happening. Is there any solution to that?

Thank you!



 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@pal95 

Put the following in your OnVisible property of your screen:

   UpdateContext({lclResetScroll: true}); UpdateContext({lclResetScroll: false})

 

Then set the Visible property of your Canvas to : !lclResetScroll

 

It's a bit of a hack, but it has worked successfully for us.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

7 REPLIES 7
RandyHayes
Super User III
Super User III

@pal95 

Put the following in your OnVisible property of your screen:

   UpdateContext({lclResetScroll: true}); UpdateContext({lclResetScroll: false})

 

Then set the Visible property of your Canvas to : !lclResetScroll

 

It's a bit of a hack, but it has worked successfully for us.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Unfortunately, it does not work, data card is still scrolled down when entering the screen

RandyHayes
Super User III
Super User III

@pal95 

Hmmm...that little hack trick used to work in the past. 

I'll see if there is another hack for it (in fact I will need to look at it because that was a method used in some of our past apps - when it worked).

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Thank you, I would appreciate if you can recheck it

RandyHayes
Super User III
Super User III

@pal95 

Yes, so here is what to do...

Place a Timer in your screen.  Set the Duration to 100.  Set the AutoStart to true.  Set Visible to false

In the Visible property of your top datacard (Y=0) set the formula to (yourTimer.Value=yourTimer.Duration) || yourTimer.Value=0

 

Now I need to look at some old apps and see if I did this there or if I had the old method.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Thank you, it started working since I put 'false' in a screen before and 'true' in OnVisible (same as you). If I put them both in the same place, PowerApps is just ignoring it, but if there is some time between them, then the scroll resets.

RandyHayes
Super User III
Super User III

@pal95 

Yes...thus was the point with the timer.  It provided a half second pause. The nicer thing with the timer was that there were no variables involved.  Always opt for less variables to maintain in your app.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,536)