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 / The difference between...
Power Apps
Unanswered

The difference between ThisItem and Gallery.Selected

(1) ShareShare
ReportReport
Posted on by 435

I am setting a variable on the next arrow of a gallery.

Set(_selectedItem, Gallery.Selected)

When I try to use this variable to refer to a record for deletion, the Remove() function will not accept my variable.

Remove(Entity, _selectedItem)

However if I change my Set() statement to this

Set(_selectedItem, ThisItem)

it does work. Either one appears to work for RemoveIf, and for every other function I have tried. What exactly is the difference between ThisItem and Gallery.Selected that specifically the Remove function would only work with one?

Categories:
I have the same question (0)
  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @Boneckrh19 ,

     

    Syntax

    Set( VariableName, Value )

    • VariableName - Required. The name of a global variable to create or update.
    • Value - Required. The value to assign to the context variable.

    However, Gallery.selected it can be seems as one variable,you can use, Remove(datasource,Gallery.selected)

     

    More information:

    function-set

     

    Hope this could be helpful.

     

    Best Regards.

    Yumia

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for posting in the community @Boneckrh19 - can you review the above reply and advise if it was helpful?

     

    @Anonymous 

  • RBoneck Profile Picture
    435 on at

    I was wondering what the differences are between a record variable saved with Gallery.Selected versus one saved with ThisItem. Clearly one difference is that Remove does not work with the Gallery.Selected one, but why is this the case? And what else might be different between them?

    This information is not in the documentation for the Remove function or the Set function. It seems to be a very specific use case, so I don't imagine this information is in the documentation for any powerapps function. I was hoping someone else had come across a similar use case and could share their experience.

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