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 / Data Table losing focu...
Power Apps
Unanswered

Data Table losing focus causing OnSelect function to take two clicks to fire

(0) ShareShare
ReportReport
Posted on by 16

I have a screen with a Data Table (call it "Screen 1") where I have an OnSelect function on one of the Columns that navigates to another screen ("Screen 2") that displays details about the selected record.  I have a "Back" button on Screen 2 that allows you to navigate back to Screen 1.  The OnSelect function works perfectly when Screen 1 first loads, but once I navigate away to Screen 2 and then hit the back button to get back to Screen 1, it now takes two clicks on the Data Table to fire the OnSelect function.  It's like the Data Table loses focus.  If I click anywhere on the Data Table and then click one of the rows, it will navigate to Screen 2, but it's odd that it takes the second click in order to do that.  What's even weirder is that it works fine in the PowerApps previewer, but doesn't work once published and launched.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    OK, so I have setup a very primitive version of what I think you have.

     

    So a screen called Screen5, not that that matters. With a DataTable hooked up to a SharePoint List with OnSelect of the first column configured

     

    HenryARPhillips_0-1614120066021.png

     

    I click an entry which takes me to screen6, that has a back icon, configured as Back() and a DisplayForm, set to the same DataSource as the DataTable on screen5 and the item of the Form set to

    HenryARPhillips_1-1614120147677.png

     

    I click the back icon and am able to immediately click another item and it will keep going with one click. So unless there is something fundamentally different in your setup, we should be safe to say that it should work how you want it.

    Now things I would check are conflicting controls. So for example the other day I had working visible controls just disappear on me and in the end I had to ensure that whilst that control was present, the other controls were not visible for the controls to remain consistently. So definitely check that.

    Also and it pains me too, but that previewer is handy but should never be taken as gospel as that has done me over many a time with appearing to work as I would want it to, only to do something completely different when coming to run the app for real 😞

     

     

  • AS-10101654-0 Profile Picture
    16 on at

    Thanks for looking into this!  It helped me to do some more digging on my end too.  The data source that I'm using for my Data Table is SQL based, so that got me wondering if that could be making a difference.  And sure enough, it seems to be the case.  I replicated your test by using a SharePoint list as the data source: lo and behold, it works exactly as expected and as you've described.  Then, if I take those same controls (Data Table on one Screen 1 and a Display Form on Screen 2) and link them to my SQL data source, it malfunctions as I've described.

     

    The other weird thing is that when the app first loads to Screen 1, it only takes one click to navigate to Screen 2 - it's only when I've returned to Screen 1 a second time that it takes two clicks to fire the OnSelect function.  And I don't even have to click the same row twice.  I could click anywhere in the table and then click a different row, and it will Select the row of my second click.  That's what got me thinking about focus, because it seems like the first click somehow re-focuses the Data Table and the second click then works as intended.

     

    Also, I double checked my test by changing back to the SP list (and the expected/desired functionality returned) and then changed back again to the SQL table (and the malfunction returned).  I'm not sure why the source of the data would make a difference here.  Any thoughts on why that might be the case?

     

    Thanks again!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

    I actually have one of those up my sleeve but cannot show due to containing customer data.

     

    However when I checked that works fine.

    At first I thought it might have been because I have a New and Edit button above the Table that you click to then do some logic based on the selected item. So I set the same logic in the on click of one of the columns and when coming back it was immediately selectable.

    I then thought was it because on the loading of the screen that hosts the data table I do a refresh of the data source but removing that, it still worked.

    So the only possible difference but not sure why it would make a difference is my table in Power Apps is technically a SQL view and not a straight table.

    Other suggestion, is to try bringing the data table to the front of the screen.

  • AS-10101654-0 Profile Picture
    16 on at

    That's interesting! My table is also a SQL view instead of an actual table from the database.  I hadn't thought to try different tables from the database yet to see if there's different behavior, so I'll give that a try.

     

    Also, to the point of bringing it to the front of the screen, I made a brand new app from scratch with just two screens.  On the first screen, the only control is the Data Table.  On the second screen the only control is the Display Form.

     

    I even tried another variation where I didn't even navigate to a different screen.  Instead, I toggled the Visible property of the data table and the Display form when an item was selected.  Got the same behavior as I've described.

     

    I'll mess around with some more variations of this and see if anything shakes out.  I'll also try creating a demo table in the database so that I can share screenshots as well!  Thanks again for your help so far!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard