cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RTW
Level: Powered On

Conditional Auto Height

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!

3 REPLIES 3
WillPage
Level 8

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.

Highlighted
RTW
Level: Powered On

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
Level 8

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.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,636)