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 / Conditional formatting...
Power Apps
Unanswered

Conditional formatting controls for one gallery item only with a delegated filter query

(0) ShareShare
ReportReport
Posted on by 10

Hey everyone,

 

I currently have a gallery of items that is pulled from a very large list, and each of the items need to be editable. 

 

I created an edit and save button on the form, and I want to change their formatting depending on which item is going to be editted. So the edit button in disabled displaymode while editting and the save button in edit displaymode etc.

 

Using UpdateContext does not work, because then it will apply to all of the items, not just the single gallery item I want to edit.

 

I can patch the source, but it can't hold any temporary data because I'm using a delegation.

 

How can I get this to work?

Categories:
  • rebeccas Profile Picture
    2,591 on at

    I'm not sure if I am missing the direction you are going here...but..you can use IsSelected in the gallery.

     

    I often use this for the Template fill so the line in Gallery I have selected is a different color. It basically allows you to show something for only the one item in your gallery that is chosen.

     

    Let me know if I missed what you were asking for.

  • christoffeldg Profile Picture
    10 on at

    Thanks, that's exactly what I'm looking for.

    How would I exactly set the IsSelected property of the gallery item? Is there some out of the box checkbox control I need to add to my gallery?

  • rebeccas Profile Picture
    2,591 on at

    An example of a way to use IsSelected is...say you have an icon that you only want visible for the one row of your gallery that you have clicked on. You could set the visible property of that icon to:

     

    ThisItem.IsSelected

     

    Or to show a certain color

     

    If(ThisItem.IsSelected, Black, Red)

     

    Hope this helps!

  • christoffeldg Profile Picture
    10 on at

    Ah, I'm afraid that won't work. I need to control the IsSelected property in some way.

     

    When researching online I found this solution, but this only seems to work with non-delegable data sources:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Update-context-for-one-gallery-item-only/m-p/238107/highlight/true#M69870

     

    I'm looking for something similar.

  • christoffeldg Profile Picture
    10 on at

    I just found a solution for anyone interested.

     

    I'm keeping a separate collection that contains the IDs of the items I'm editting. 
    This is function that happens when someone clicks the edit button:
    Collect(EditList, { EditModeID: ThisItem.ID});

     

    The function when someone clicks the save button:

    Patch(...);
    Remove(EditList, LookUp(EditList, EditModeID = ThisItem.ID));

     

    The displaymode setting on the controls:

    If(!IsBlank(LookUp(EditList, EditModeID = ThisItem.ID)), DisplayMode.Edit, DisplayMode.View)

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard