Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Make dynamic size of gallery

(0) ShareShare
ReportReport
Posted on by

Hi, hope you are doing great!

I am working on a PowerApps. I am using a ‘Gallery’ to capture information filled by user.

+ Button at right top, makes gallery visible and can further add more rows by clicking on + button.

 
 
 

Dynamic gallery 1.png

 

Formula on 'On Select' property of + button -

Collect( 
NewCollection, 
   { 
      CItemSerialNumber: Text(Last(NewCollection).CItemSerialNumber + 1),
      drpActionItem: "", 
      txtOtherActionItem: "", 
      txtDescription: "", 
      drpStatus: "",
      txtNotesActionTaken:"",
      txtClosureOwnerName: "",
      dteClosureDate: "" 
   } 
)

 

Requirement : Gallery size is static. After clicking on + button, gallery is visible at bottom. If, user has to add more rows that gallery looks crowded with lot of info.

Need to make gallery size dynamic. So, once user clicks than gallery should appear on top of main screen.

 

Dynamic gallery 2.png

 

Appreciate your help to achieve dynamic gallery size.

@WarrenBelz @RandyHayes @AJ_Z 

 

  • AJ_vizMan Profile Picture
    AJ_vizMan on at
    Re: Make dynamic size of gallery

    This is easy and simple solution. Thank you @v-jefferni for help.

  • Verified answer
    v-jefferni Profile Picture
    v-jefferni on at
    Re: Make dynamic size of gallery

    Hi @AJ_vizMan ,

     

    You can use context variables to change the Gallery position. So:

    1. OnSelect of the add button:

    UpdateContext({GalleryY: A Y axis value for the Gallery you want to put, GalleryH: A height value for the high Gallery})

     

    2. OnSelect of the Cancel and Save button, add the following formula after your original formula:

    UpdateContext({GalleryY: The Y axis value of the Gallery's current position, GalleryH: The height value of the short Gallery})

     

    3. Set Y axis of the Gallery to GalleryY

     

    4. Set Height of the Gallery to GalleryH

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,318 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,111 Most Valuable Professional

Leaderboard