Hi, I have an app sourced from an Excel file on OneDrive. One of the datacards has much more text than the others. I've had to turn Auto height off, as Auto height seems to have a limit that cuts out a lot of the text. Therefore, I've given the datacard a height that is equal to the biggest text feild. The problem now is that the quantity of text for that datacard varies quite a lot, so some searches have an empty white area before the next datacard. Is there any Height code I can use - or any other solution? Thanks!
Solved! Go to Solution.
I can't think of another straightforward way of making the field or card size adjustable to the text content.
Instead of setting the card size to accomodate the largest text, can you try making the corresponding card field scrollable (Overflow = Scroll)? This would allow having smaller cards.
I can't think of another straightforward way of making the field or card size adjustable to the text content.
Instead of setting the card size to accomodate the largest text, can you try making the corresponding card field scrollable (Overflow = Scroll)? This would allow having smaller cards.
This worked - and it also improved the functionality and design of my app in the process! Many thanks!
Hello Dinusc,
I created a simple SharePoint Form from a custom list and am struggling to adjust the datacard height values - they seem to have a limit set on their height property, and the minimum height allowed is still too tall! I looked for a way to implement your recommended solution (Overflow=Scrollable) but I can't seem to find said property? Am I missing something? Where can I set the "Overflow"?
Thanks!
Hi Kbarber,
My suggestion was to set the overflow on the label inside the card. This is to ensure that any content can be displayed in the label field that is a part of fixed-size data card.
Thanks for the clarification @dinusc. While helpful in its own right, I don't think it will address my issue. Here is a link to my post in case you're interested in getting more details:
Here's how I resolved this issue:
1) Card is only one in its row and WidthFit = True
2) Set Card Height to 0
3) In the data card Text Input control, enter formula for height:
30 + ((RoundUp(Len(Parent.Default)/100,0) -1) *20)
This will effectively give me the AutoHeight feature i was looking for.
Explanation of the formula: 30 +((RoundUp(Len(Parent.Default)/100,0) -1) *20)
30 = minimum height
100 = characters per row
20 = height per row
thanks @SJacobs - I'll give this a try soon - seems to be quite a clever workaround
I have had to modify that formula to address the possiblity of null values and linefeed characters within the text. Blank values are handled by adding 15 if IsBlank returns true. Linefeed characters is more of a problem. I searched for Char(10) and added 20 to height if found, but that only works if there is a single linefeed. I do not know how to count the number of linefeeds within a string.
Here's my current version of the formula for height.
35 + ((RoundUp(Len(Parent.Default)/100,0) -1) *20) +If(Find(Char(10),Parent.Default)>0,20,0) + If(IsBlank(Parent.Default),15,0)
Note: I'm using OpenSans size 13 font. Line Height is set to 1.2
I had a situation where I was trying to mimic an editable PDF. I had HTMLText for the DataCardKey's to present nice formatted Questions. No matter how meticulus I was witht he HTML the auto height would fail on one of the many fileds.
What I did was a bit interesting.
I have a Large list with all the formatted HTML questions in a sharepoint list.
Title, Body, Height, Part
Body is the HTML, Part is the PartNumber, Height is how big I want the KEY size.
I used simple lookups to pull the correct height for each DataCard. Its a static approach but its solid and the questions wont change once setup. Because the Columns were names Part1,Part2,Part3... I was able to hookup Lookups that refer to the DataField name "Part1". Because of this the same Code applied across all Datacards.
Auto height sometimes wont workout esp in HTML text controls.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
209 | |
194 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
249 | |
120 | |
83 | |
55 |