web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error message: "Select...
Power Apps
Unanswered

Error message: "Select of a control that is within a container control, such as a gallery, from outside the container. Select can be used within a container control when both controls are within the same container."

(0) ShareShare
ReportReport
Posted on by 19

I am getting this error message:  "Select of a control that is within a container control, such as a gallery, from outside the container. Select can be used within a container control when both controls are within the same container."

 

 

 

sdfsdfsfsdfsfsd_1-1710398495874.png

 

I am using the Select(Gallery Name, Row Number) function

to select the gallery and the particular row in the gallery.

Select(SPRGallery, cvSPRGalleryRowNumber);

The Select() function is being executed in the screen's OnVisible event.

 

sdfsdfsfsdfsfsd_2-1710398594590.png

 

 The selected row is highlighted using the gallery's TemplateFill property.

 

But sometimes I get this error message.

sdfsdfsfsdfsfsd_3-1710400716985.png

 

Can someone explain why I am getting this error?

But the error does not occur every time.

 

 

Categories:
I have the same question (0)
  • leden Profile Picture
    28 on at

    I am getting the same error. I am also calling the Select(myGallery) in the screen's OnVisible event, but have now tried putting a button into the same container as the gallery (the button and the gallery are siblings in a container), and even pressing this button manually produces the same error. I am not passing a row number. In my case the message always occurs.

    Sorry, I don't have a suggestion, but you are not alone.

     

     

  • RPeoples Profile Picture
    4 on at

    I just started seeing this error as of 4/8 - it was working perfectly on 4/5.  New version released?

  • LS-04091539-0 Profile Picture
    19 on at

    I got this response from a Microsoft Escalation Engineer if it would help anyone:

     

    The error you're reporting is saying that you cannot do Select() on a control within a gallery, because we have no way of telling which instance of the control you want selected.  That control is going to be instantiated for each time in the gallery, so there could be dozens or hundreds of instances of it.

     

    To specify, you need to use the other parameters available for the Select() formula, which let you specify the row and child control to be selected.  For example if I want to do Select() on the first instance of Button1 in my gallery, I can do this:

     

    Select(Gallery2, First(Gallery2.AllItems), Button1)

     

    If I want to do Select() on the SelectedItem from the gallery, I can do it this way:

     

    Select(Gallery2, Gallery2.Selected, Button1)

  • leden Profile Picture
    28 on at

    Thank you, this is very helpful and makes a lot of sense.

    The documentation hints at this but is I think in need of correction, as it suggests that the second parameter should be an integer (index of record) whereas you are saying it should be the record itself.

    leden_0-1715924549950.png

    Also to address "because we have no way of telling which instance of the control you want selected", couldn't it assume that if the 2nd and/or 3rd parameters are omitted then it is the Gallery2.Selected record which should determine the record to select, and the gallery's OnSelect event that should be fired?

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard