cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
farhandsome
Helper IV
Helper IV

PowerApps Positioning Based on Gallery

Hi all,

 

I have a design question as far as PowerApps goes. Please reference the below image: PowerApps Gallery Positioning.PNG

 

It's maybe not clear just from the picture, but the "S030" and "S035" items with their respective progress bars in the background are actually part of a gallery. Further more, the object in the front is a group containing a label, gallery, etc. The foreground gallery is set to visible once a user selects one of the background gallery "information" icons. Depending on which icon in the background gallery they select is what will filter the foreground gallery. I would like to position this pop-up gallery based on which background gallery icon the user selects. For example, if the user selects the information icon from the gallery item denoted "S030", I would like for this pop-up to position itself right underneath the gallery item like so:

 

PowerApps Gallery Positioning 2.PNG

 

Is there a way to get the specific position of a gallery icon respective to it's parent item?

 

Thanks,

Farhan

1 ACCEPTED SOLUTION

Accepted Solutions

Yes. Let's say S030 and S035 are Title properties within the gallery. In other words, the values for ThisItem.Title is what equals to S030 and S035.

Then for the icon, you can set its OnSelect as
If(ThisItem.Title = "S030", Set(galPosition, "left", Set(galPosition, "right"))

Now when you click on the icon, it should do what you want it to do.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

4 REPLIES 4
PowerAddict
Super User
Super User

Yes, make the position of the gallery dependent on what is selected.

Say for example if the left icon is selected, and that the OnSelect of that icon sets a variable to say left,
Set(galPosition, "left")

For the other icon, it will be:
Set(galPosition, "right")

Then change the X position of the gallery to:
If(galPosition = "left", 0, 300)

I assumed 0 and 300 are the values of X position where you want the gallery to be placed. If not, change these to te values you want.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

@PowerAddict,

 

Thanks for the quick response! The only issue I see is that these are actually not separate icons - they are the same icon within different items of a gallery. Is it possible to set a variable based on which item is selected?

Yes. Let's say S030 and S035 are Title properties within the gallery. In other words, the values for ThisItem.Title is what equals to S030 and S035.

Then for the icon, you can set its OnSelect as
If(ThisItem.Title = "S030", Set(galPosition, "left", Set(galPosition, "right"))

Now when you click on the icon, it should do what you want it to do.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,852)