cancel
Showing results for 
Search instead for 
Did you mean: 

Being able to target 'This' for controls like Buttons.

As the subject suggests, the ability to use 'This' on any control would be extremely useful for at least my use case and I am sure it will at least be mildly useful for others as well. To go a little more in-depth about this, for instance, if you have a Button, and wish to use the Text attribute to update a variable. You need to specify the 'Button name'.Text to use that value, however, if you could just use 'This'.Text or something like This.Data.Text (since the actual text value is in the DATA of the Button).

 

TL:DR = Let controls be able to access their own values using 'This'.

 

BTW, I'm new to PowerApps and if there is a way to do this or if there is a reason we should be able to do this then my bad.

Status: New
Comments
Level: Powered On

Hello,

 

while I was looking for this as well while doing my first tries with PowerApps, now, some months later, I don't think, this is really neccessary. Like you mentioned, you can retrieve the value you're looking for via the controls name.

 

If you're working with Galleries, you can access data from the currently selected row by using ThisItem.property

This is, where you actually really need a functionality like that.

Level: Powered On

You are correct simb55, I only ran into this issue while testing out an application idea while getting ready for a client. The app I created is a mock of POS for a restaurant were you use buttons to do things like add food items to a 'receipt'. Each screen had about 25+ buttons, and I just felt that it was inefficient to have to go in and change the onSelect value for each one on each page to get change the value of what was pushed to the 'receipt'. Granted, I realized quickly that Power Apps is just not the platform for making POS in the way I was.

 

Now, if I was to have broken out my tables further I'm sure this wouldn't be an issue as I could just use the items and make a gallery and target the values this way. However, in my naive first attempt at creating an application, I kind of dug myself into a hole.

Level: Powered On

@yiqi0110 wrote:

as I could just use the items and make a gallery and target the values this way.


Reading your problem description, I suggest, you go ahead and do exactly this 🙂