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 / Gallery Controls Help
Power Apps
Answered

Gallery Controls Help

(0) ShareShare
ReportReport
Posted on by 46

Hello All!

 

Fairly new to the PowerApps environment and need some assistance with some gallery related controls.  Here is a description of the situation:

 

I have a screen that has a gallery in it.  When the user selects an item in the gallery I'd like to have a couple of things to happen:

  1. When an item is selected, a popup appears with a couple of buttons in it that will direct the user to a form based on their choice.  I'd like for the popup to appear and disappear as the user clicks the selection (like toggling it's visibility on or off, or when they hover over the gallery maybe?).
  2. Once the user makes the selection (items are in a Sharepoint List), I need to capture the selection and pass that value to an EditForm when they click the button in the popup.

 

So far, I've been able to pass a gallery selection to an edit form for updating an existing record using 

Navigate(scr_UpdateForm,ScreenTransition.Fade,{sel_VarEN:ThisItem})

then using

Item = sel_VarEN

to show the selected item in the EditForm.

 

The problem I'm having is passing that same value to the form through the popup when the button is clicked.  The buttons the user can choose from are Update the Selected Item or Add/Create a Sub-Item for the Selected Item.

 

Thanks in advance for any assistance ya'll can provide!

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @More2Learn ,

    Firstly, a better use of the Gallery Variable would be to have the Item of the Form as 

    LookUp(
     SPListName,
     ID = sel_VarEN.ID
    )

    That way, you are querying the list directly and the form will update without re-generating the Variable. I assume selVarEN is a Global Variable.

    But to your question - OnSelect

    Set(sel_VarEN,ThisItem)

    Visible of the pop-up

    sel_VarEN.ID = GalleryName.Selected.ID

    and then simply Navigate from the pop-up button depending on the button pushed. The Variable is already set. One small item - on the OnVisible of the Gallery screen

    Set(sel_VarEN,Blank())

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • More2Learn Profile Picture
    46 on at

    WarrenBelz,

     

    Thank you very much for help on this topic!  Hope you enjoyed your Christmas Holiday!

     

    I ended up needing to modify an unrelated gallery to make it work correctly but it works exactly as intended now.  I do have a question though, in the advanced tab / properties for each item in the app do I need to enter functions/items/variables in the order that I want to them to happen, or will all of the items happen when it is called?

     

    The reason that I ask is because I had the Set(sel_VarEN,ThisItem) after the Navigate(...,...) and it didn't work, but when I put the Set() in front of the Navigate() it does.

     

    Navigate(scr_Yadayada,ScreenTransition.Fade);Set(sel_VarEN,ThisItem) > Doesn't Work

    Set(sel_VarEN,ThisItem);Navigate(scr_Yadayada,ScreenTransition.Fade) > Does Work

     

    Is there a way to put the Set() inside of the Navigate() so that it happens when the user leaves that screen?  Not sure I need that behavior now, but I'd think it might be useful to be able to do that.

     

    Happy New Year!

     

    Take Care,

    More2Learn

     

  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @More2Learn ,

    You need to Set the variable directly when you select the item - once you navigate off the gallery, ThisItem is no longer relevant, although you could (for what reason I do not know) do this

    Navigate(scr_Yadayada,ScreenTransition.Fade);
    Set(sel_VarEN,GalleryName.Selected)

     

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard