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 / Selecting row and colu...
Power Apps
Answered

Selecting row and column from table.

(0) ShareShare
ReportReport
Posted on by 204

Right now it seems that you can only do Selected.[NameOfColumn] to get the field for the selected row.

However, there is nothing that would allow you to retrieve the row of the selected cell/element.



Basically what I'm asking is if anyone knows a way to get the name of the column and the row of a particular cell that I've selected in a table? Tables now only seem to be able to select rows.

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Could  you be more specific with regards to what you want to do with the results of  your request?  If it is simply to display the results, then a DataTable control is the easiest way to do that.  A Data Table always shows the rows and column names of a datasource and can be filtered by its items property. The attachment shows a DataTable filtered by the text in the TextInput box above it, in this case TextInput*.  The items property is "Search(Doctors,TextInput8.Text,"Fname")".

    datatable.PNG
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @agneum,

     

    Could you please share a bit more about your scenario?

    Further, could you please show more details about the table that you mentioned?

     

    I found that you have post same issue within this forum before, please check the following thread:

    https://powerusers.microsoft.com/t5/Creating-Apps/Get-selected-column/m-p/144802#M3866

     

    If you want to get the name of the column and the row when you click a cell (or a record) within the Data table control (Like that within Excel spreadsheet), I afraid that there is no way to achieve your needs in PowerApps currently.

     

    If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

     

     

    Best regards,

    Kris

  • agneum Profile Picture
    204 on at

    Exactly, I want to get the name of the column and the row from the Data table control. Right now "Selected" functionality will only give me the selected row.


    Added a suggestion, hopefully it will be added sometime... It would really help because then you could easily manage records as cells instead of lists. 

     

  • agneum Profile Picture
    204 on at

    In your image, imagine a second column for "age". Then imagine being to click on any field in your data table (either it be a name or age) and then getting both the selected row and its column name. As you may have noticed, powerapps will mark rows when you click around in your data table, but it cannot mark a "cell" like in Excel.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have always used a gallery to achieve a selected record (row) and the ability to extract any of its column data. 


    Here is how I would do it: 
    Connect the gallery to your data source so you can set a global var which will be used to store the entire selected record. 

    Then set the galleries "On select" function with the following expression: 

    Set(My_var_record, ThisItem); 

    Then you can use that variable wherever (since it is a global variable you can reference it on all screens) and however you want in your app (you can get any column data from the record), or you could even use it as the record for another data source or search/filter query etc.. 

    To get any column name from the record variable use the following expression: 

    My_var_record.ColumnName 

    Note: 'My_var_record' is just an example name, but you can please give your variable a unique and meaningful name. 

    This is not the only way to store a selected item, you can also use collections, but I tend to only use collections when I'm planning on patching data in progressively from multiple places, before patching it back to the data source in one write, or storing more than just the one record to use elsewhere. 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard