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 / selected item changes ...
Power Apps
Unanswered

selected item changes when navigating

(0) ShareShare
ReportReport
Posted on by 30

I have an app connected to a SQL database with a datatable on the home page. The selected row in the datatable defines which information is shown on the next screen - the user navigates through a button that sets a global variable with datatable.selected and navigates to the information screen. 

This have been working fine for several weeks now - and I have not changed anything on my app since 2 hours ago, but suddenly after pushing the button, the selected value is changed to the first record in the data table and the information page shows the wrong information.

Is this a bug? 

All inputs are appreciated. @murali can you check this out? thanks!

Categories:
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    Is there a Reset() or a Refresh('datasource') being used?

  • tfarsund Profile Picture
    30 on at

    @Jeff_Thorpe wrote:

    Is there a Reset() or a Refresh('datasource') being used?



    No, I have not added something like that - how could this fix the issue? 
    Additional information: the issue is not apparent when I preview the app - only when published.

    Thanks!

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @tfarsund ,

    Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.

     

    Please consider take a try with the following workaround:

    Within your Home Screen, set the OnSelect property of the "Navigate" button to following:

    Set(CurrentItem, DataTable1.Selected);
    Navigate(DetailScreen, ScreenTransition.None)

    Then within your Detail screen (information screen), reference values from the CurrentItem variable using the following formula:

    CurrentItem.ColumnName

    If you add a Display form within your Information screen to display the detail info, please set the Item property of the Display form to following:

    CurrentItem

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    @tfarsund ,

     

    The Reset() or a Refresh('datasource') wouldn't help resolve the issue but could be a cause of the issue and that is why I was asking it you were using them.

  • tfarsund Profile Picture
    30 on at

    Hi @v-xida-msft, thank you for your reply.

    This is practically what I have done - and it has been working for several weeks. So I do not believe the code is the problem here.
    I did some 'debugging' and the newly emerged issue seems to occur when both the global variable (in your example CurrentItem) and navigation is set onselect of the button.

    I found a workaround with two buttons, one that is visible (Original button) and one that is not visible(NavigateButton): 
    - Original Button properties: Set(CurrentItem, Datatable1.Selected);Select(NavigateButton)
    - NavigateButton properties: Navigate(DetailScreen, ScreenTransition.None) 

    .. I think it is weird that this is necessary..

  • tfarsund Profile Picture
    30 on at

    @Jeff_Thorpe I see!

    I have several resets in the OnVisible property of the page(resetting the filters being used on the table) but I dont think this should affect the selected person after the page is loaded? In addition, I have not changed these in a long while.
    I also tested to remove the resets and the issue still remain. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard