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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can I set up X and Y f...
Power Apps
Unanswered

Can I set up X and Y for an object to match X and Y of a select item in a gallery?

(0) ShareShare
ReportReport
Posted on by 362

I have a text label that I'd like to pop up when selecting a control inside a gallery near the selected control. I was able to get the X to work, not the Y.

 

This is the process I'm using:

MyGallery control

OnSelect =  Set(varX,Self.X); Set(varY,Self.Y)

 

MyControl

X=varX

Y=varY

 

Thanks!

Categories:
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Gilmour 

    Are you trying to do something similar to my gallery from the right ?

    ezgif.com-video-to-gif.gif

    If so, use a control inside gallery and set its Visible property to 

     

    ThisItem.IsSelected

     

     Hope it helps !

  • Gilmour Profile Picture
    362 on at

    Hi @gabibalaban , thank you for your response.

     

    Actually, imagine your little bell is outside the gallery.

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Gilmour ,

    There can be a solution , but you can implement it only on  a data source that support CountRows() function (like DataVerse) or on a collection. 

    The main problem is that you don't know what is the number of the item selected by user. So, you need to alter the Items data by adding a column for this info (I call it "Index"). My example is based on default gallery items in powerapps (CustomGallerySample).

    Set Gallery1 Items to:

     

    ForAll(
     Sequence(CountRows(CustomGallerySample)),
     Patch(
     Index(
     CustomGallerySample,
     Value
     ),
     {Index: Value}
     )
    )

     

     Having the index column, the outside control Y property will be:

     

    Gallery1.Y+(Gallery1.Selected.Index-1)*Gallery1.TemplateHeight+(Gallery1.Selected.Index)*Gallery1.TemplatePadding

     

    I didn't took in consideration a relative Y dimension of a control inside Gallery you want to align with. For that the formula should be:

     

    Gallery1.Y+(Gallery1.Selected.Index-1)*Gallery1.TemplateHeight+(Gallery1.Selected.Index)*Gallery1.TemplatePadding + ControlInsideGallery.Y

     

    Hope it helps !

     

  • Gilmour Profile Picture
    362 on at

    Hi @gabibalaban, thank you for your advice. Will give it a try!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard