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 / select a data record i...
Power Apps
Answered

select a data record in the gallery by command

(0) ShareShare
ReportReport
Posted on by 356

Hello community,

there is a command in Powerapps that allows me to select a certain data record in the gallery using a formula so that it can be used in another place in another screen, e.g. the command galleryxyz.selected ... works?

 

Is that possible?

Thank you for your help.

 

Best regards

RoScha

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,121 Most Valuable Professional on at

    I don't think there is a way to do this using a command.  The Select() function points to a control on screen, not a record.  The common usage is Select(Parent) in a gallery to select the control that hosts a specific record in a gallery.  But I 've never seen a way to do this other than from inside a gallery.

     

    However, in most places where you would use the Gallery.Selected property to refer to a specific record you can also do a Lookup() to get a specific record.  So I think the workaround would be programmatically set a variable that contains an index value for the record from the data source and then do a lookup on the data source or gallery to get the record, rather than selected.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @RoScha 

    Yes, the GalleryX.Selected will refer to the currently selected record in the Gallery.  This may change based on actions within your app though.  If you need to take a snapshot of the record at the time of selecting a record, then I would utilize a global variable to capture the currently selected item and not rely on the .Selected property of the gallery.  This, again, will depend on your app.

     

    As for selecting a specific record by default, then you can utilize the Default property of the Gallery to do this.  Internally, PowerApps will maintain the current selection unless the underlying datasource is changed and it impacts the Items property significantly (i.e. there is more to your Items formula than just a datasource).  In that scenario, you would need to provide logic in your Default property of the Gallery to lookup the record you want (and it must match EXACTLY to the record schema of the Items property).

     

    The other thing you can utilize is the Select function.  For Select, you can, for example, do Select(yourGallery, 3) this will select the 3rd item in your Gallery.  The unfortunate part of that is that you really never know the item position of any of your gallery items to effectively select the right one...but in some cases you can surmise the correct row.

     

    I hope this is helpful for you.

  • RoScha Profile Picture
    356 on at

    Hello @Pstork1 

    hello @RandyHayes 

     

    Thank you for your answers.

     

    Best regards

    RoScha

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 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard