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 / Highlight current Reco...
Power Apps
Suggested Answer

Highlight current Record - Table and Form on a Preview screen

(1) ShareShare
ReportReport
Posted on by 79

I need some advice on a requirement I’m working on.

I’m using a Table and Form on a Preview screen. When I click on an item in the left container, it correctly highlights the selected record.
However, as soon as I click anywhere on the right container (the form), the highlight on the left side disappears.

How can I keep the selected record highlighted on the left container until I explicitly select another record or complete an action on the right container?

Categories:
I have the same question (0)
  • Dhanush Pamarthi Profile Picture
    8 on at
    Could you please confime me that you'r using template screen?
  • Suggested answer
    11manish Profile Picture
    3,033 on at
    Store the selected record in a variable and use that variable to control both the form and the row highlighting.
    // Table/Gallery OnSelect
    Set(varSelectedRecord, ThisItem)
    Set the form's Item property:
    • varSelectedRecord
    Use the variable for row highlighting:
    If(
        ThisItem.ID = varSelectedRecord.ID,
        ColorValue("#D6EAF8"),
        Color.White
    )
    This keeps the selected record highlighted even when the user clicks inside the form. The highlight will only change when another record is selected or when you explicitly clear the variable.
  • Suggested answer
    Valantis Profile Picture
    6,488 on at
     
    The highlight disappears because clicking the form shifts focus away from the gallery, clearing its TemplateFill selection state. Storing the selected record in a variable decouples the highlight from gallery focus.
     
    Exact implementation:
    Table/Gallery OnSelect:
    Set(varSelectedRecord, ThisItem)
    Form Item property:
    varSelectedRecord
     
    Table/Gallery TemplateFill property (this controls the row highlight):
    If(ThisItem.ID = varSelectedRecord.ID, RGBA(214, 234, 248, 1), RGBA(0,0,0,0))
     
    The key is using TemplateFill on the gallery template, not a separate rectangle or color control. TemplateFill is the correct property for row-level background color in the modern Table control and in classic galleries.
     
    One extra tip: if the form has a Save/Cancel button and you want the highlight to clear after submitting, add Set(varSelectedRecord, Blank()) to your submit OnSelect. If you want it to persist across submits, just leave it.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • WarrenBelz Profile Picture
    155,721 Most Valuable Professional on at
    I will take a guess here that you may be using using a Modern Table - if so, these are still in Preview and have a number of limitations compared with a Gallery.
     
    You can set a Variable for the record selected, but have to use
    Set(
       varRecord,
       Self.Selected
    )
    but this does not solve your highlighting issue as a Table's use of this is purely focus-based. As well, the Table does not have a TemplateFill, IsSelected or Default property like a Gallery (nor Item) and the FontColor property applies to all records (you cannot refer it to only the selected item).
     
    You can easily achieve what you need with a Gallery with the TemplateFill - simply 
    If(
       ThisItem.IsSelected, 
       Color.LightBlue, 
       Color.White
    )
    and visually, it should look exactly like what you have.
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • yashgoyal Profile Picture
    79 on at
    All, Thanks for trying to support me...
    Just want let you know I am using New Screen template .. 
    So options mention above not avaible ... TemplateFill property  is not avaible ...
     
  • Suggested answer
    WarrenBelz Profile Picture
    155,721 Most Valuable Professional on at
    My assumption seems to be correct - you have a Modern Table there. You cannot do what you need with one of those controls - you need to use a Gallery with the TemplateFill property I posted.
     
    If you want some guidance on how to do this, please post (in Text) the Items of your current Table.
     
    Please Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 475

#2
WarrenBelz Profile Picture

WarrenBelz 387 Most Valuable Professional

#3
11manish Profile Picture

11manish 289

Last 30 days Overall leaderboard