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

Height of a datacard

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft Employee

Re: Height of a datacard

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.

View solution in original post

11 REPLIES 11
Highlighted
Microsoft Employee

Re: Height of a datacard

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.

View solution in original post

designAV
Level: Powered On

Re: Height of a datacard

This worked - and it also improved the functionality and design of my app in the process! Many thanks! 

kbarber
Level 8

Re: Height of a datacard

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!

Microsoft Employee

Re: Height of a datacard

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.

Capture.PNG

kbarber
Level 8

Re: Height of a datacard


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:

https://powerusers.microsoft.com/t5/General-Discussion/Height-of-datacards-in-SP-List-Custom-Form/m-...

SJacobs
Level: Powered On

Re: Height of a datacard

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

kbarber
Level 8

Re: Height of a datacard

thanks @SJacobs - I'll give this a try soon - seems to be quite a clever workaround

SJacobs
Level: Powered On

Re: Height of a datacard

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

nickduxfield
Level 8

Re: Height of a datacard

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.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,514)