Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 78MlLUfrbtkfbqSX5YFUeH
Power Apps - Building Power Apps
Answered

Detect when selected row in a data table is changed

Like (0) ShareShare
ReportReport
Posted on 1 Apr 2022 08:24:58 by 260

Hello

 

I want to display data using a data table.

 

The data table has a list of users

 

When the selected user is changed, I want to add the selected user's email address to a text box

 

Annoyingly there doesnt seem to be an event in Data Table for the selected row has been changed

 

How can I do this?

 

Paul

  • Verified answer
    BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 06 Apr 2022 at 07:51:30
    Re: Detect when selected row in a data table is changed

    Hi @paulinuk ,

     

    I think the easiest way for this is to set the Default property to a variable that is then updated by either selecting an Email address in the DataTable, or by entering a text:

     

    TextInput.Default = varEmail
    
    TextInput.OnChange = Set(varEmail,Self.Text)
    
    EmailColumn1.OnChange = Set(varEmail, DataTable.Selected.Email)

     

    You may have to change some of the identifiers.

  • paulinuk Profile Picture
    260 on 01 Apr 2022 at 15:29:33
    Re: Detect when selected row in a data table is changed

    Hi

     

    Not sure what you mean here

     

    I have a list of users that are being displayed in the data table 

     

    email address is text

     

    So when a different user is selected in the grid I want to take that users email address and add it to the email address text box

     

    So the user either enters an email address in the text box or selects a user from the table to fill it

     

    Paul

  • BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 01 Apr 2022 at 15:13:47
    Re: Detect when selected row in a data table is changed

    Hi Paul,

     

    Can you then please clarify what data type you are using? Text or Person/Group?

     

    Also, do you want a Single or MultiSelect?

     

  • paulinuk Profile Picture
    260 on 01 Apr 2022 at 15:02:59
    Re: Detect when selected row in a data table is changed
    Hi 
     
    I don’t want the user having to click a button 
     
    Is there a solution that would avoid this?
     
    im not using this to update the data
     
    This is an email page so the user is clicking on the row for the user they want to email
     
    Cheers
     
    Paul 
  • BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 01 Apr 2022 at 14:58:04
    Re: Detect when selected row in a data table is changed

    Hi @paulinuk,

     

    I have made a quick test and it is not that hard to do with a Patch() function:

     

    BCBuizer_0-1648824814716.png

     

    So first the user selects the row they want to update, then fill the new value and finally click the button to make the change.

     

    The OnSelect property of the button will have to be adjusted to match your identifier names, but it does the trick for the test:

    Patch(TEST,LookUp(TEST,Title=DataTable1.Selected.Title),{UserID : TextInput3.Text})

     

    Please note this is for columns with a Text data type. If you are using a Person/Group type, you have to replace the TextInput for a PeoplePicker and adjust the Button.Onselect statement slightly to be able to handle Records.

  • paulinuk Profile Picture
    260 on 01 Apr 2022 at 13:40:06
    Re: Detect when selected row in a data table is changed

    Hi 

     

    I dont mean changing the user 

     

    I mean if there is a grid of 10 users, the first user will be selected by default

     

    The user selects the third user, I want to update an edit box with that user's email address (Having the edit box tied to the table directly is not an option)

     

    This box will be used for the user to either enter an email address manually or to populate it from the selected user in the data table, hence the reason for it not being possible to link the edit box to the data table directly

     

    Paul

  • BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 01 Apr 2022 at 09:49:08
    Re: Detect when selected row in a data table is changed

    Hi @paulinuk ,

     

    It is not possible to edit information in a data table, so I'm not sure how that links into the change of user you mentioned...

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 32

#2
Rajkumar_M Profile Picture

Rajkumar_M 16 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 14 Super User 2025 Season 1

Overall leaderboard
Loading started