cancel
Showing results for 
Search instead for 
Did you mean: 

Self reference named operator for controls

Could we please have an operator like ThisControl which works in a similar way to ThisItem/Parent but for controls?

This is usefu if you want to reference one of the control's other properties when setting the value for another property (i.e. make the border the same colour as the text, where the text is a formula).

For example

TextBox1.BorderColor = ThisControl.Color

This way, when you copy the control, the reference is still ok.

Thank you.

Status: Completed

This is possible today using just the control name. 

 

For example:

If my control is named TxtAddress, I can use the name of the control from the property of any other control to match the color.

 

If I wanted the color of the TxtCity Control to be the same as TxtAddress, then I would change the Color property of TxtCity to be:

TxtAddress.Color

 

Let me know if this works for you. Thank you for your continued feedback, 

Audrie

Comments
Flow Staff
Status changed to: Completed

This is possible today using just the control name. 

 

For example:

If my control is named TxtAddress, I can use the name of the control from the property of any other control to match the color.

 

If I wanted the color of the TxtCity Control to be the same as TxtAddress, then I would change the Color property of TxtCity to be:

TxtAddress.Color

 

Let me know if this works for you. Thank you for your continued feedback, 

Audrie

Level: Powered On

This works, but it would be convenient to have a generic operator like ThisControl for bulk-updating control properties.

 

If I have 10 existing text box controls and want to update all of their .BorderColor properties to equal their .Color properties, right now I have to go through each control 1 by 1 and use its name. This is doable, but it would be convenient to just be able to select all 10 and update the BorderColor property to a single formula.

Level: Powered On

Hi @Audrie-MSFT I love that we can do that.  It helps make my app very dynamic.

 

I love @Steelman70's idea for the same reason that @swolfsohn pointed out.  As someone who loves how dynamic we can make our apps, I feel like a simple feature like this would go a very long way in saving time.

 

 

Level 10

I don't agree that this idea has been completed, as others have pointed out, having to use the name of the control every time (and continually type it) is VERY inconvenient.  

 

Basically what I think we're looking for is the equivalent of ThisItem (in galleries and such) or even Parent to get to the parent control, but in this case this should be the current control.  

 

Since we can get to the Parent control using Parent instead of having to go back and find the name of it, there is no reason why we shouldn't be able to get to ourselves by a similar thing. 

 

Imagine if I always used my name to refer to myself in real life  - or perhaps to illustrate the point I could rewrite that as:

 

   "imagine if Brian always used Brian's name to refer to Brian's self in real life"

 

This is basically the same as having to use the control's name within the control to get to one of it's members.  Smiley LOL

 

As @swolfohn mentioned, having to refer to the control by its name within itself is VERY inconvenient, especially when you cut and paste controls (or several, perhaps grouped, that was used for a "composite" control).  If we had Self or whatever it would be called, then we wouldn't have to go back and manually change references to a control that was just trying to reference other members within itself when we copied and pasted it.  

 

This would eliminate a LOT of errors, as well as time.  (if I cut and past now a control that references other members in itself - guess what it refers to?  Not the newly pasted control - but instead the ORIGINAL control - imagine how many errors this causes?  This would DEFINITELY help improve reusability of work.

 

After all - if the need was seen to have ThisItem and Parent available (which I agree with of course) - this is no different than that and just as necessary.

 

 

PLEASE consider adding this feature!!  This would save me SO much time and definitely reduce errors.  Personally I consider this one high priority to making PowerApps more usable and more able to be used by non-developers which the goal is.  

 

Level: Power Up

I wholeheartedly concur with BrianR's comments above.

Can we please have this feature?

Level 10

Hi @Audrie-MSFT

This idea has not been completed, can you please fix the status?

The idea is about the properties of a control being able to reference other propoerties of the same control, not other properites of another control.

Is this clear?

Level 8
Bump @Audrie-MSFT This item is not completed. Is this being tracked somewhere else as a potential feature? Thanks!
Level: Powered On

@Audrie-MSFT, I couldn't agree more these comments. Please can you reopen this?


Personally, I would go further, shortening ThisItem to just This, or maybe Self

Parent shouldn't be ParentItem, so the same should follow the self reference.


Need, need, need....

 

 

Kaine

Level: Powered On

Agreeing with this idea for another Bump! This is not completed. 

It can not be that hard to implement an operator for Controls that references itself. Currently missing this feature rather frequently. The most recent example was when trying to update all the datacards in a form with a formula that wanted to reference said Datacard's 'DataField' property. Having to individually update every Datacard's Visible property manually with 

... 'Datacard Name'.DataField...

instead of something like

... Self.DataField...

is just very inconvenient.

Please implement this! <3