cancel
Showing results for 
Search instead for 
Did you mean: 

Parent & Me - please add reference to the control itself.

We can reference control to a parent (Like Parent.Width, .Height, .Fill, etc.). For the controls however we have to reference it by it's name. So when I have a control name 'Label1' I can reference it bij Label1.Width, .Height, . Color, .Fill, etc.

 

It should be a great idea to add a global reference to the control itself. Me comes in mind as a good name for this parameter. So Me.Width, .Height, .Fill, etc.

 

This parameter would make it faster to copy formula's from control to control or add a formula to multiple selected controls. An example:

 

Say I have ten controls (Control1,2,3,4,5,...) and I want them to be at the left off my screen. I can then select them all and just do  the following formula on the X parameter: 

Parent.Width - Me.Width

 

Current I must adjust the formula for each control like:

Parent.Width - Control1.Width // for the first control
Parent.Width - Control2.Width // for the second control
Parent.Width - Control3.Width // for the third control
// and so on

This is time consuming because I have to copy/paste/adjust for each individual control.

So I would make a major time reduction to be able to do all ten controls in the same time.

 

Status: Completed

This is provided with the self fx shown below.

 

Adding @FilipK from the Power Apps team in case there are any follow-up questions, since I don't see it in the formula reference doc here yet.

Comments
Advocate IV

It would be great for using the configured forms again

Regards,

MarcelLee

Kudo Kingpin

Totally agree with this.  For reference, note that this appears the same as the followed two ideas:

 

 

Ability to reference items in a control using "Self"

 

Self reference named operator for controls

 

In addition to saving time, having a "Me" or "Self" also reduces errors.  Today if you copy a control, without having a "Me", "Self", "ThisControl", etc reference and having to reference the original control direclty by name, the copied control in many cases (such as code blocks) would still reference the ORIGINAL control not the new copy (even if PowerApps might otherwise "fix up" some of the references, this probably wouldn't affect code blocks).  So having Me/Self/ThisControl type of reference would help to eliminate these types of errors too.


 

New Member

+1  I think this is essencial in this 'object orentied' way of referencing things. 

 

e.g. in JS you have the 

this

class reference

Power Automate

Thanks so much for this feedback. Adding @GregLi to comment on roadmap opportunities.

 

Thank you,

Audrie

Power Automate
Status changed to: Under Review
 
Resident Rockstar

@Audrie-MSFT

 

Great to here this is under review. Hope this will be added so on to PowerApps. 

 

Greatings Paul

Advocate III

That will save alot of time ,great idea indeed

Resident Rockstar

@Audrie-MSFT

 

He Audrie, hopes this comes soon to PowerApps. Today it took me four hours to change references which will take me only 5 seconds when this feature comes available.

 

Any insights on when this will be brought to PowerApps? Are we talking weeks or months?

 

Thanks in advance for the reply.

 

Paul

 

 

Resident Rockstar

@Audrie-MSFT 

 

Just wondering what the status is for this Idea. Status is set to Under Review eight months ago, so hope to see it soon goïng to Planned Status. Gould you give us an update Audrie?

 

Thanks Paul

Regular Visitor

Suggested use case--change the color of a control when the user changes its value:

 

If(Me.Value = Me.Default, Color.Red, Color.Black)

 

I could then copy this formula to every control (and attribute) I want to have this effect. Right now I have to spell everything out:

If(<name of control> = <spell out the control's default value>, Color.Red, Color.Black)

 

This gets really annoying really quickly when applying it to many items.