cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

show name of an object as text in a label

Hi, could you please help me to understand how should I put the name of an object as text in a label object?

I have a button and when I select it I'd like to show its name as text in a label.

 

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: show name of an object as text in a label

Hi @alessandro2020 ,

You cannot use Variables to reflect object, field or list names as even if they are the same name, they are different values. There is no property on the control to automatically identify its name and you actually have to put in the name to refer an object to itself (such as ComboBox1.Selected.Value)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: show name of an object as text in a label

You can create a variable and set the variable to the name of the button when it is clicked then set the text value of the label to the variable.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
New Member

Re: show name of an object as text in a label

Thank you.

Could you tell me the correct syntax to assign the name of the button to a variable? is there a property of the object to identify its name or should I set the variable with a string that is the real name of the object?

Highlighted
Super User
Super User

Re: show name of an object as text in a label

The OnSelect of the button would look something like this:  Set(varButtonName, btnMyButton.Text)

 

Your names might be different based on the name you give your variable and the name you gave the button control.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
New Member

Re: show name of an object as text in a label

If I'm not wrong the .text property does not reflect the name of the object. The text value of my button is "no value". In the label I'd like to show the name of the object and not the text value.

 

Is there anything like "thisitem.name" that I could use to identify the name of my object?

 

Thank you

Highlighted
Community Champion
Community Champion

Re: show name of an object as text in a label

Hi @alessandro2020 ,

You cannot use Variables to reflect object, field or list names as even if they are the same name, they are different values. There is no property on the control to automatically identify its name and you actually have to put in the name to refer an object to itself (such as ComboBox1.Selected.Value)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,609)