Showing results for 
Search instead for 
Did you mean: 
Memorable Member
Memorable Member

Reference a Controls name?

Is there a way to access the name of a control?



  • control 1 is named "sombrero"
  • If I copy it 100 times, I have "sombrero_1", "sombrero_2"..."sombrero_99"
  • I want to write a function for the X property of all sombreros like:
    • X = buffer.Text + sombrero.Width * Right(sombrero.ThisItem, 3)

I could be totally off here, and there is another way to this, to access the name of a control?



Hi seadude,



Apologies if I misunderstand you, but it seems like you're not only trying to get to a common property across multiple controls but also trying to reference a relative property of a control within one of it's properties - I'm not sure how you can do it the way you're trying to do it as I've never come across anything like a master object model you can navigate in PowerApps, including being able to reference a this instance of a control.


You can set all the control's X property to the same variable and then manipulate that, but if the manipulation also needs to reference a property of that specific control then I'm stumped.


so, eg: variable for property X;

  • Sombrero.X = varSombreroX
  • Sombrero_1.X = varSombreroX
  • ...
  • Sombrero_99.X = varSombreroX


To manipulate the X value for all these controls, you can then use UpdateContext() - so;

UpdateContext({varSombreroX: value})


will update the X property for all controls that have it, regardless of their name - but if you want "value" to be dependent on something within each specific control and therefore different for each control, (like the length of the text in that control), then I don't think you can reference it dynamically.


Will watch this thread with interest 🙂



@RusselThomas, thanks for the thoughtful reply. I actually think I made a mistake in my original post...


The goal is:

  • sombrero_41.X = sombrero.Width + buffer.Text * <thisSombrerosNumber> -1


I had "+" in the original post rather than " * ".


You could imagine: This would be a fast way to build a grid of items on the screen. Without this, you have to go into each Control and set the X Property of EVERY ONE like this:


  • sombrero_41.X = sobmbrero_40.X + sombrero.Width + buffer.Text

Is there another way to self-reference a Control?

Hi seadude,


Not that I'm aware of 😞


Even in galleries, pre-populated controls that use auto-height/auto-spacing are rendered with the absolute name of the relative control it's being spaced from - and PowerApps doesn't accept strings as object references, so I'm really not sure it's possible.


Sorry I couldn't help - perhaps someone else knows a way, but if it turns out to be impossible, perhaps consider logging an idea on the Ideas forum? 🙂


Kind regards,







@seadude, it sounds like you want to duplicate controls and have their position respond according to their name.


This sounds like a use case for a gallery 🙂


Whenever you think of duplicating things, think of the gallery. There's a few ways to go about this, I'll share an interesting one.


Create a table with a column that specifies the X location you want.

Insert a control--we'll call it sombrero.

Set the X property of sombrero to the column that has the X location.

Repeat for Y if you want.

Set the TemplateSize of the Gallery to 0.


The position of the object will be relative to the dimensions of the gallery. You can do a lot of creative things this way.

Microsoft Employee

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,111)