web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : ozVk4XsY3HlnSicQ8kTPdm
Power Apps - Building Power Apps
Unanswered

Conditional Auto Height

Like (0) ShareShare
ReportReport
Posted on 27 Nov 2019 18:01:22 by 180

Hi folks.

 

In my current PowerApp I have an Html Text Box that interprests a snippet of CSV data and render an HTML table. What I would like to do is have it so that, as much as possible, a scroll bar does not render. Initially I had it set to simply auto height which worked to an extent but if there was a large amount of data it would take up too much space on the app.

 

What I've done is I've created and hidden a copy of this HTML text box that is the same width and contains the same information. I have hidden this from the user and set the height to auto-height. On my main text box I set the Height property to Min(HiddenText.Height, 450)

This behaves as expected but is a little... clunky. Is there a property or setting I'm missing? Thanks in advance!

Categories:
  • PauloRech Profile Picture
    105 on 21 Oct 2021 at 23:29:40
    Re: Conditional Auto Height

    Hi @RTW 

    To solve your issue, you need to create 2 HTMLText controls, in the same X and Y position. One over another, same Width.
    BUT, here is the trick!
    The first one, called HTMLText_1 (for example), must have Visible=False and AutoHeight=True. You will use it just to determine the needed height.
    The second HTMLText control, called HTMLText_2 (for example), must have Visible=True and AutoHeight=False. This one will show the data in screen. 
    Then, you will set HTMLText_2.Height=Min(HTMLText_1.Height, 300).


    So, you will limit the Height of your text to 300, in this example.

     

    Does it solve your issue? Please, let me know!

    Thanks.

  • WillPage Profile Picture
    2,107 Super User 2025 Season 2 on 29 Nov 2019 at 21:28:50
    Re: Conditional Auto Height

    Yeah that's exactly what I was thinking. You'll obviously need to experiment. If it's always an HTML table going in there and the cell height is fixed it should be predicable by counting the rows of the collection or data source that's going into the table.

  • RTW Profile Picture
    180 on 29 Nov 2019 at 14:25:19
    Re: Conditional Auto Height

    @WillPage , I just want to make sure I'm getting this correctly. I'd figure out in what length amount of data I would need to get to my maximum desired height, and create a logical statement that turns auto height off if it is greater than that, or on if it is less than that?

  • WillPage Profile Picture
    2,107 Super User 2025 Season 2 on 27 Nov 2019 at 20:46:13
    Re: Conditional Auto Height

    AutoHeight is a boolean input, so you can use that to evaluate the length of the string in the Text property, or the number of rows of your CSV data, e.g. Length(HtmlText1.Text) > 200 or if your CSV data is in a collection, CountRows(col_CSV_Data) > 20 or whatever. Set the Height property statically to the maximum you want it to be.

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