Power Apps ThisItem, Parent and Self

With lasts week’s new Self feature in Power Apps, I thought that it would be useful to have a look at Self, Parent and ThisItem.

First of all Power Apps ThisItem, Self and Parent are not functions, They are more like properties within the current context. Within Power Apps these are called Named operators.

You can recognize these properties as they don’t have () that include properties.

Self Example

I will start with an example of Self. When I click a button the text of the button. This is then displayed in a label.

All the properties of the button are available through the Self operator.

Setting a variable to Self.Text
Setting a variable to Self.Text

In a similar way I can use Self with Icons and any other controls.

Using Self.Icon to get the icon
Using Self.Icon to get the icon

Parent property

Similar to Self I can use Parent to refer to the parent control of the current control. So in the example below I’m using the parent operator to get to the properties of the Screen that the button is part of.

Parent example in Power Apps
Parent example in Power Apps

When buttons are part of galleries for example Parent will refer to the gallery that it is part of.

As shown below I can use parent.selected to make a button inside the gallery find the selected item in the gallery.

Access a control within a Parent
Access a control within a Parent

ThisItem in Galleries

ThisItem is the 3rd of the operators that I’m going to look at in this post. ThisItem refers to the current data structure within the gallery. Noticed that this isn’t the item that is selected.

For each section in your gallery the ThisItem refers to a different record.

ThisItem example within a gallery
ThisItem example within a gallery

Where Self and Parent were returning Controls, this this item is giving us the records from the data source.


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Related Posts

2 thoughts on “Power Apps ThisItem, Parent and Self

  1. Is there a way that I can get a control name, something like Self.Name for Text Input, Label, combo box etc.? Thanks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.