cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Boneckrh19
Kudo Kingpin
Kudo Kingpin

The difference between ThisItem and Gallery.Selected

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?

3 REPLIES 3
v-yuxima-msft
Community Support
Community Support

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

Anonymous
Not applicable

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

 

@Anonymous 

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,795)