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 / 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:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 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,270 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

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard