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 / Grey out non-selected ...
Power Apps
Unanswered

Grey out non-selected gallery items and not have an Edit Form populated

(0) ShareShare
ReportReport
Posted on by 49

Hello all,

 

I'm onto building my second app (using galleries and forms) and have been unable to figure out how to get the following to happen.

 

Environment:

 

Screen 1

Gallery 1  (Source is a Sharepoint List)

  • Has a list of employees and certain items (Name, Phone, Job Title)
  • Each Parent item has a check box at the end to allow users to select that item.


Screen 2

Gallery 2 (Source is selected items from Gallery 1 in a collection called Screen1Collection)

  • Top 2 items selected from Gallery 1 are visible (need to scroll for more)
  • Items in this gallery have an edit button (may change this later)
  • Below Gallery 2 is the edit form (source is Sharepoint list as I can't seem to limit it to Screen1Collection and this works for now) prepopulated with Gallery 2 Item 1 details

 

I would like it so the Edit Form is blank and disabled (but still visible) until one of the items in Gallery 2 is selected.  As soon as any one of the items is chosen, I would like the remainder of the items in Gallery 2 to be "greyed out".

 

I can potentially live with a non-blank form at screen change, as it does correctly change when other Gallery 2 items are picked. 

 

 

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WABGOR_Dave 

    You don't need to collect into a collection the selected items in your first Gallery...the gallery is already a collection/table.

    On your screen 2, set the Gallery Items property to:  Filter(Gallery1.AllItems, CheckboxName.Value)

    This will give you the filtered list of all the items checked in the first gallery.

     

    Also on Screen2, in the OnVisible action of the screen, add the following formula:  UpdateContext({lclRecord: Blank()})

    Then on your Gallery2 OnSelect action, add the following formula:  UpdateContext({lclRecord: ThisItem})

    Then set the Form Item property to : lclRecord

    Finally, set the Visible property of the Form to : !IsBlank(lclRecord.ID)

     

    I hope this is helpful for you.

     

  • WABGOR_Dave Profile Picture
    49 on at

    @RandyHayes not only are you a super user, you're a superstar! 🙂 

    I was going to use a "sub collection" on Gallery1 so that I could potentially use it as a preview/temp table before changing any records permanently.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WABGOR_Dave 

    Thanks! 🙂

    Yes, no collections needed because your Gallery already has all that you need.  

    The problem with the collections is that you can only set/change them on behavioral actions (On...), So that means a lot of formulas to do so OnCheck, OnUncheck, etc.  
    But the reality is, the gallery already has all of this available and can be referenced without the need for a behavioral action.  Makes it super easy!

  • WABGOR_Dave Profile Picture
    49 on at

    Also,  I'm guessing there is no way in a Gallery to "grey out" or even remove the non-selected items "edit button" like so:

     

    WABGOR_Dave_0-1635169350817.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WABGOR_Dave 

    Are you referring to the second Gallery or the first?

     

  • WABGOR_Dave Profile Picture
    49 on at

    My sample was from screen 2, Gallery2. Originally I was using a button on screen 1 that would create a collection after the user had checked off the boxes (items they wanted to modify).  This was what I had in the "modify selected users" button for OnSelect in screen 1, Gallery1:

     

    ClearCollect(selecteditems,Filter(Gallery1.AllItems,Checkbox1.Value))

     

    Then I had the "selecteditems" as the Items value for Gallery2.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WABGOR_Dave 

    Yeah, you don't need that because you're really just taking a snapshot of a table into a collection...which is more than needed.  First - always best to put snapshot tables that are not going to be changed (add/remove/update) into a variable:  Set(selectedItems, Filter(....))

     

    However, again, none of that is needed as your Gallery has all that already, it's just duplicating and consuming more app memory and time.

     

    But, I am not clear what you mean then on the second screen about graying out non-selected items??  

    Are you stating that you want a Gallery (screen1) to be a full list, and then when the user clicks on the modify button, they are taken to screen 2 where the gallery there shows ALL of the users still, but has all the non-selected users from the first screen grayed out??

  • WABGOR_Dave Profile Picture
    49 on at

    @RandyHayes You got it! Screen 1 is the "main menu" (modify, remove, add users) with a Gallery 1 (check box items of users).  Screen 2 will have the "sublist" of checked off users that you want to modify (my screen shot). I was then going to make a Screen 3 or modify Screen 2 to have the ability to add a user.  I wanted Screen 2 to then have the gallery items it had listed "refreshed" with any changes made, and then, allow the user to modify/write back to the Sharepoint list after they had a chance to verify the items they changed.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WABGOR_Dave 

    Then set the Items property of the second gallery to : Gallery1.AllItems

    Then, for the records you want grayed out, set the DisplayMode property of the controls to:

       If(ThisItem.Checkbox.Value, Edit, Disabled)

     

    As for adding on that screen...no problem.  As long as the Gallery1 is based on the datasource and not some other collection, it will all happen dynamically.

    The only factor that can be an issue with the add, is that, depending on your Gallery1 items property, the checked items on the first screen could go back to default.  If this is a factor, then that can be worked around easily.

  • WABGOR_Dave Profile Picture
    49 on at

    @RandyHayes thanks ever so much for tips! I'm about 90% there on getting it to do what I want. If you know the answer to this one awesome, if not I'll close this issue off and open up a second question on here:

     

    If you have a button that shows on each item/record in the gallery, can you set the item/record to View or Disabled and still have the button as being actionable (edit, not view or disabled)?

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard