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 77

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,029 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

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 471

#2
WarrenBelz Profile Picture

WarrenBelz 395 Most Valuable Professional

#3
11manish Profile Picture

11manish 279

Last 30 days Overall leaderboard