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 / Dynamic Y based on sel...
Power Apps
Unanswered

Dynamic Y based on selection in a gallery?

(0) ShareShare
ReportReport
Posted on by 294

Hi,

I have two galleries. Gallery 1 contains a list of 5 items. Gallery 2 contains the details of each item from Gallery 1.

I would like to position the location of Gallery 2 right next to the selected item from Gallery 1 (i.e. dynamic Y based on the selected item from Gallery 1).

Doable?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @karimabdelrazek ,

    Firstly, the Selected Item of a gallery does not have a Y Property.

    Depending on the possibility if this going off the screen, it would be (sort of) achievable by collecting the first list

    ClearCollect(colFirstList, FirstList)

    Adding a number column to it

    Clear(colYRef);
    ForAll(
     colFirstList,
     Collect(
     colYRef,
     Last(
     FirstN(
     AddColumns(
     colFirstList,
     "RowNo",
     CountRows(colYRef) + 1
     ),
     CountRows(colYRef) + 1
     )
     )
     )
    )

    Then setting base the First list on colY and the Y of the second list to something like

    (colY.Selected.RowNo * Gallery2.TempleSize) + Gallery2.Y

    I have not tested any of this - it is a concept.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • karimabdelrazek Profile Picture
    294 on at

    @WarrenBelz . Thank you for the concept! I'll try it out and let you know if I got it to work or not.

  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @karimabdelrazek ,

    I have just tested it and this works (except as I mentioned, it can go off the screen if your numbers are big enough)

    Gallery1.Selected.RowNo * Gallery1.TemplateHeight + Gallery1.Y

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • karimabdelrazek Profile Picture
    294 on at
    Thanks so much Warren! You beat me to it! 🙂
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @karimabdelrazek ,

    A bit of fine-tuning - I am actually going to use this myself. This will line the second gallery up exactly with the top of the selected item on the first on every selected item.

    Gallery1.Selected.RowNo * 
    (Gallery1.TemplateHeight + Gallery1.TemplatePadding) + 
    Gallery1.Y - Gallery1.TemplateHeight

     

    FloatingGallery.gif

  • Community Power Platform Member Profile Picture
    on at

    Hi there,

    I am having a similar issue, but I'm a beginner in PowerApps.  I would need exactly the output that @WarrenBelz  posted. However, I cannot make my second gallery to show only the items that the user chose/clicked on from the first gallery.

     

    Longer description:

    Gallery A has software names (Items = taken from SP list), Gallery B has license types names (taken from another SP list). I would need for Gallery B to do what it's showed above in the gif: to show a list of license types based on the user selection (I need to record that afterwards).

    I cannot make the Gallery A arrows clickable (nothing happens) and neither Gallery B to show dynamic content.

    May you please help with what code to put where? I tried Filtering and others but nothing worked so far.

     

    Many thanks!

     

     

  • MartinVGD Profile Picture
    5 on at

    Hi I made a variable onStart Set(varVisible; True) and then set the OnSelect on the Arrow to Set(varVisible; !varVisible). Then you need to set the Visible property on the Gallery B to varVisible

  • Community Power Platform Member Profile Picture
    on at

    Thank you for the feedback, appreciated! Will try that, sounds like this could work now.

    All the best to you!

     

  • PrudhviL Profile Picture
    136 on at

    Hello,

    I am looking for the same requirement, Have you tried the concept did it work for you?

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard