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 / Highlighting multiple ...
Power Apps
Unanswered

Highlighting multiple rows in Gallery

(0) ShareShare
ReportReport
Posted on by 240

Hello everyone,

 

Hope you are well,.

 

Please could someone assist me, i am hoping to highlight multiple rows in a gallery based on whether a checkbox within the gallery is selected?

 

Many thanks

Chris

 

 

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Appy1 In the TemplateFill property of the Gallery place this code

     

    If(ThisItem.checkbox.Value, Color.Green, Color.White)

     

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

     

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at

    Use a formula in the TemplateFill property of the gallery to change the color based on the checkbox.  Something like this:

    If(ThisItem.checkbox1.Value,Color.Yellow, RGBA(0, 0, 0, 0))
  • CC-19121430-0 Profile Picture
    240 on at

    Hi @CNT 

     

    Thanks for your message, i have tried your suggestion and it doesn't seem to be working.

     

    If(ThisItem.Checkbox1.Value=true, Color.Green, Color.White)

     

    It seems to have an error when entered that states "Name isn't valid. - 'Checkbox1' isn't recognized".

     

    There is also the error "Invalid use of "."

     

    Any help much appreciated, 

     

    Many thanks

    Chris

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Pstork1 

     

    Sorry, it is the same for your suggestion, i am having an error when entering it.

     

    'The function 'if' has some invalid arguments.'

    'Name isn't valid. 'Checkbox1' isn't recognized.'

     

    When using the formula provided the rows aren't highlighted unfortunately.

     

    Many thanks

    Chris

     

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at

    Checkbox1 needs to be the name of the column that the checkbox is displaying.  Checkbox1 is just a placeholder in my example.

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Pstork1 

     

    Apologies, i havent really used checkboxes before, are you saying that it would need to be related to a column in my data source? similar to how i have using ThisItem.example in the Items property of my text labels etc. 

     

    any help is really appreciated, i am still feeling fairly new to creating apps so any help you guys on this forum can give me is great.

     

    Thanks

    Chris

  • Verified answer
    Pstork1 Profile Picture
    68,678 Most Valuable Professional on at

    Yes, it needs to be related to an item in your data source. If you just add a checkbox to the gallery template and don't bind it to a column it will check and uncheck for every record each time you check it.  The value has to reflect the value of a column in the record or its just a repeating checkbox.  And yes it would work just like the ThisItem.somecolumn in your labels.

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Pstork1 @CNT 

    Sorry to revive this topic.

     

    I have attempted to do what you suggested, by ticking the checkbox i wish to highlight the row which works, but also change a text input assigned to the particular row on the gallery.

     

    I have added to the Default Property of the Checkbox - ThisItem.'Check Box' which is a column i have added to my excel sheet data source.

     

    Am i missing something else? As currently it changes the TextInput for all records.

     

    Many thanks

    Chris

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at

    How are you using the checkbox to change the textinput?

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Pstork1 ,

     

    This is what i am using for this, kindly providing by @CNT on a separate topic thread.

     

    In the OnVisible of the Screen,

    Set(varText, Blank())

    In the OnSelect of the button 'set to leaver',

    If(Checkbox1.Value = true, Set(varText, "Leaver")); Notify("This Record will be removed overnight - status set to leaver",NotificationType.Information,5000)

    In the Default property of the TextInput,

    If(IsBlank((varText), Gallery1_1.Selected.Status, varText)

     

    Many thanks for looking at this,

    Chris

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard