Hi @arpost,
Do you want to make the width and height of component dynamic changes based on the strings within the labels?
If you want to make the width and height of component dynamic changes based on the strings within the labels and ensure that its height and width do not exceed the screen,I am afraid that there is no directly way to achieve this in Power Apps currently.
If you want to achieve this, it is necessary to set a limit for Height and Width of the Label, however, there is no way to set a Height limit for a AutoHeight property of the Label.The AutoHeight property expects a Boolean value, if you want to set the maximum height for the Label control and the Container control, the data types will not match.
If you only want to dynamically change the width of the component based on the strings within the labels while ensuring that its width does not exceed the screen, and you can accept to use the scroll bar to display all the strings in the label control.
Here is an alternative solution for your reference.
1.Add a Container Control.
2.Add 3 Label Control and apply the following formula on its Width property as:
If(25*Len(Label1.Text)>App.Width-140,550,If(Len(Label1.Text)=0, 25, 25*Len(Label1.Text)))
3.Select the Label Control and apply the following formula on its Overflow property as:
If(25*Len(Label1.Text)>App.Width-140,Overflow.Scroll,Overflow.Hidden)
4.Select the Container Control and apply the following formula on its Width Property as:
Max(If(Label1.Visible=true,Label1.Width),If(Label2.Visible=true,Label2.Width),If(Label3.Visible=true,Label3.Width),25)
Result screenshots:
