Skip to main content
Community site session details

Community site session details

Session Id : /SSMSL9Z7uDp2ftWDGmLt2
Power Apps - Building Power Apps
Answered

Disable button until text field is scrolled to end

Like (0) ShareShare
ReportReport
Posted on 30 Apr 2023 13:20:33 by 102

Hi,

I have a text label in my app, lab_terms,  which contains Terms and Conditions.  It is scrollable and contains more text than will fit on a single screen.

On the same screen there is a button, btn_Next, that advances the user to the next screen.

I'm want to use DisplayMode to disable the button until the user has scrolled to the end of lab_terms, but I'm not having any luck.

Is this possible? Or am I wishing for a beer and money tree again?

  • Matt_uhb Profile Picture
    102 on 30 Apr 2023 at 21:01:44
    Re: Disable button until text field is scrolled to end

    A very good point.  

    Thanks again

  • BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 30 Apr 2023 at 20:52:02
    Re: Disable button until text field is scrolled to end

    Hi  @Matt_uhb ,

     

    Indeed you're right, instead of referencing the Slider.Max, the Slider.Min property should be referenced to make sure the user has scrolled to the bottom. I'll amend the post you marked as the solution.

     

    The reason I reference this property instead of a hardcoded value is because the content of the label may change over time. With these settings, the solution will automatically adapt to the changes instead of you having to make changes in multiple places to get things to work again.

  • Matt_uhb Profile Picture
    102 on 30 Apr 2023 at 20:30:54
    Re: Disable button until text field is scrolled to end

    Ok, first of all, genius solution, @BCBuizer, thanks.

    However, the way it works is the opposite of the desired behaviour, i.e. as it is, the button is initially enabled, then becomes disabled as you slide it.

     

    So I set the slider (sld_termsScroll) height to the height of my container and dropped a temporary label in there with the Text value as sld_termsScroll.Value to show me what the min value would be at when at the bottom of the scroll (-1813).

    I then set the DisplayMode of the button to 

    If(sld_termsScroll.Value < -1800, DisplayMode.Edit, DisplayMode.Disabled)

     And it is all good.

    Thanks again for your help.  have a good one.

     

    Matt.

  • Verified answer
    BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 30 Apr 2023 at 16:58:39
    Re: Disable button until text field is scrolled to end

    Hi @Matt_uhb ,

     

    COme to think of it, the slider is probably more user friendly and easier to implement. The setup is similar to the one described before, but instead of 2 icons, use a slider.

     

    The following property settings should be used:

     

    Label:

     

     

    AutoHeight = true
    Y = Slider.Value

     

     

     

    Slider:

     

     

    Default = Self.Min
    Layout = Layout.Vertical
    Max = 0
    Min = -Label.Height + Container.Height
    ShowValue = false

     

     

     

    The Slider.Value property can now be used to determine if the user is at the bottom to enable the button:

     

     

    If(Slider.Value = Slider.Min, DisplayMode.Edit, DisplayMode.Disabled)

     

     

    Resetting the slider will move the label back to the top.

     

     

  • BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 30 Apr 2023 at 16:37:39
    Re: Disable button until text field is scrolled to end

    Hi @Matt_uhb ,

     

    As far as I know there is now property to reference which will return the where the user has scrolled to for a Label control.

     

    What you can do, is build your own scroll function that does include this functionality using a container, a label and some icons:

    BCBuizer_0-1682871842059.png

    As you can see the label is bigger than the container, but the part outside of the container is not visible. By clicking the arrow icons the user can scroll down. This works using a variable, which you can then leverage to keep track of where the user is scrolling.

     

    The property settings for this:

     

    Label

     

    AutoHeight = true
    Y = varScroll

     

     

    Icon Up

     

    DisplayMode = If(varScroll = 0, DisplayMode.Disabled,DisplayMode.Edit)
    OnSelect = UpdateContext({varScroll: varScroll+50})

     

     

    Icon Down

     

    DisplayMode = If(-varScroll+ Container.Height >= Label.Height, DisplayMode.Disabled, DisplayMode.Edit)
    
    OnSelect = UpdateContext({varScroll: varScroll-50});
    If(
     -varScroll+ Container1.Height >= Label5.Height &&
     !varScrolledToBottom,
     UpdateContext({varScrolledToBottom:true})
    );

     

     

    With these formulas, varScrolledToBottom will be set to true the first time the user scrolls to the bottom and will remain true even if the user scroll back up. It can be referenced directly in the DisplayMode property of the button to be enabled:

     

     

    If(varScrolledToBottom, DisplayMode.Edit, DisplayMode.Disabled)

     

     

    Please do make sure to properly initialize the variables, for instance in the OnVisible property of the screen that has this functionality:

     

    UpdateContext({varScroll:0, varScrolledToBottom:false})

     

     

     

    Edit: To improve the user experience, you may even throw a slider in the mix.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete