If you’ve ever used a multiple lines of text field in a PowerApps form you’ve probably been left feeling that it’s a bit lacking. It has always frustrated me how limited the text input control is in PowerApps. It only allows you to set the height and toggle between single and multiple lines of text. What about dynamic heights and max-heights? When inputting large amounts of text, setting the default height for every text box always seems to miss the mark.
There has been some good resources online covering how to allow text inputs to grow in height as you type.
However, this approach causes issues if the user is entering a large amount of text 20-30 + lines because it causes a lot of scrolling on the form. With the introduction of the experimental Container control, there is a solution.
The solution looks like this:
The ApprovalComments_Height
is a Container and has a height of:
Min(200, ApprovalComments_Text.Height)
The Min()
function is what allows for the max-height. It will grow with the text up to 200, past that it will scroll.
The ApprovalComments_Text
label has AutoHeight
turned on and its Text
property is set to ApprovalComments_Val.Text
The Height
property of ApprovalComments_Val
is set to:
Max(ApprovalComments_Height.Height, 70)
So that will appear as a multi-line text field when empty being at least 70 high and then grow with the ApprovalComments_Height
container.
For a more in-depth overview check out my How-To on YouTube
Leave A Comment