Yeah, this is a pretty common situation when you’re showing/hiding DataCards dynamically in a form in Power Apps.
What’s happening is the Form control doesn’t automatically resize based on which DataCards are visible. It keeps its original height, so even if some cards are hidden, you still get empty space or a scrollbar.
There isn’t a built-in “auto-height” for forms, but you can handle it by calculating the height based on the visible DataCards.
If your form layout is vertical (one card per row), you can set the Height of the form like this:
This works because:
Form1.AllItems gives all DataCards
Filter(..., Visible) keeps only the visible ones
Sum(..., Height) adds up their heights
If you have some spacing/padding between cards, you can add a small buffer:
If your form has multiple columns, then it gets a bit trickier because items are arranged in rows. In that case, you may need to:
- Keep the form single-column for dynamic layouts
- Or switch to a custom layout using containers instead of a form
So basically, Power Apps won’t auto-adjust the form height for you, but you can calculate it based on visible DataCards to remove the scrollbar.
Best regards,
Satyam Pandey
✅ If this helped solve your issue, please mark it as Accepted Solution so others can find it quickly.
❤️ If it was helpful, please click Yes on “Was this reply helpful?” or give it a Like.
🏷️ For follow-ups, feel free to tag @TechFreak
💼 LinkedIn
▶️ YouTube