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 / Return the column's nu...
Power Apps
Answered

Return the column's number in a list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I just started with Powerapps and ran into an issue:


At one point in my App. I need to navigate to a screen that shows details about an item selected in a list. Said item is created moments ago by the user and is thus not yet selected. Instead of selecting it however, I want the User to be able to press a button that navigates him to the Detail screen. In other words, the button selects the newly created item automatically.

So what I'm trying to do to get this to work, is to give the item an unique Id upon creation (which works). The Id is also temporarily saved as a variable.
Then, I want to filter the list for the item to whose Id that saved variable corresponds. I want it to return the number of that item's column in my list (if it's in the 31st column of a list of 50, i want it to return 31).
And then, I want to Select() that item's column using that number I got.

Categories:
  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous

     

    • Set the selected in the same variable when gallery selected
    • Set(VariableName,BrowseGallery1.Selected.ID);Navigate(DetailScreen1, ScreenTransition.None)
    • In Detail Screen set the form Item Property to
    • LookUp(Datasource, ID=VariableName)

     

    Note: By default, the item property of the form in the detail screen is Galleryname.Selected

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @StalinPonnusamy 

    Thanks for your response,
    I thought about using that too but realized that it would be quite inefficient since my app contains many elements that would require such code. Therefore, my client would prefer to use the good old List.Selected and such. Is there no other way or function that could return the item's position in a list?

    Thanks in advance
    -CyrillosB

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous

     

    Using Variables is dynamics. We can do based on condition. Form item property of Detail screen can be

     

    If(IsBlank(VariableName),BrowseGallery1.Selected,LookUp(Datasource, ID=VariableName))

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @StalinPonnusamy 

    I spoke with my client and he agreed to use the method that you presented. In other words: the solution you offered (including the one with the condition) is just what I need!

    Thanks a lot for your help and have a nice day
    -CyrillosB

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 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard