Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Make dynamic size of gallery

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,532

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,050

Leaderboard