web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic Datacard height
Power Apps
Unanswered

Dynamic Datacard height

(0) ShareShare
ReportReport
Posted on by 356

Have searched far and wide for this solution but cannot find.

I need to dynamically resize my datacard height in InterventionBrowseGallery1 so there is on overlap.

 

4 Fields in InterventionBrowseGallery1:

Title- height is 40

InterventionDate- height is 35

InterventionOfficer- height is 35

InterventionNotes- Autoheight, multiline

 

The InterventionNotes field is what is throwing me off.  I could be one sentence or many.  I used the following to get character count but I really need line count.  

 

What is the best way to make this look presentable.

 

Thx PowerApps community!

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @slhangen 

    You mention DataCard and Gallery, those are two different things, so I am assuming you are referring to a Gallery.

     

    In that case, I would put in a Flexible Height Gallery instead (unfortunately, you cannot convert one to the other).  With that Gallery, it will automatically resize based on the controls in it.  If you have the InterventionNotes set to AutoHeight, then the Gallery will change as well based on it.

     

    I hope this is helpful for you.

  • slhangen Profile Picture
    356 on at

    Flexible height never works for me.  See screenshot

     

    .Flex Height Capture.JPG

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @slhangen 

    What issue are you having with it?

     

    Keep this in mind...the view of the Gallery in "design" mode does not operate the way you would think.  However, when you Play the app (or simply press the "Alt" key in design mode) the Gallery will format properly.

  • slhangen Profile Picture
    356 on at

    As seen above, when the filed gets a lot of text in it, it overflows onto next card.  I was able to handle in the form with a formula in the datacard's height property.

     

    These note fields will be all over the place re: height.  I need the item to flex, I thought that was what autoheight does but it never works for me.  I never end up using it.

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @slhangen 

    Yes, the Flexible Height Gallery will do exactly that.  The trick is that you have to design for the minimum and you have to avoid putting further items below you expanding control.

    So, the template size (height) should never be manually (by formula) manipulated in a Flexible Height Gallery or you'll have wild results.  The height should be set in the designer to the minimum height you want the template to be.  This should include all of your controls with their minimum heights (i.e. the label that is AutoHeight should be set to the minimum height that you want it to be).

    If you have controls below the Autoheight controls (sometimes putting a separator line is desired, then its Y property should be set based on the Y and Height properties of the controls above them.

     

    Once you do that, they work perfectly for that purpose.

     

    There are other little quirks with Flexible Height galleries that have to be watched out for, but from your scenario, this is not an issue and should work just fine.

     

    JUST REMEMBER - it always looks bunched up in the Design mode (this is so you can actually see the minimum sizes and placements).  When in Play or via "Alt", they should respond properly.

     

     

  • slhangen Profile Picture
    356 on at

    I am at a loss.  Set all fields to minimum height (35) played app and still get the following on a larger note item:

    Flex Height Capture.JPG

  • slhangen Profile Picture
    356 on at

    I was thinking this might work but it doesn't:

    Item Height:

    valInterventionOfficer1.height+valInterventionDate1.height+valInterventionType1.height+valInterventionNotes1.height

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @slhangen 

    If your AutoHeight is set on the label and you are NOT doing anything in TemplateSize, or Height on the Gallery, it should all work.

    Also, make sure your labels have some padding beside 0 on them.  Padding of 0 will cause an issue with the Gallery (unknown why, but it does) - Although, I did not experience any issue with that in my test (below).

     

    I just threw together a quick app to make sure there wasn't some new issue that might have cropped up...and it all seemed fine. 

    Design:

    RandyHayes_0-1594764279889.png

    Play:

    RandyHayes_1-1594764303877.png

     

    Now I also notice in your screenshot that you have a border...how are you putting that in place?

  • slhangen Profile Picture
    356 on at

    Its just an out of the box gallery separator

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @slhangen 

    In years of PowerApps design, I've never seen an out of the box gallery separator.  Are you stating that this was on the screen when you added the Flexible Height Gallery to your screen?  Or did you add something else to it?

    Quite honestly, it look like a rectangle, and it look like that is not set to size properly?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard