Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Using variables to set properties od f control

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
Is it possible to use a powerapps global variable to set the value of an input property of a control?

I have a control that take a string as input in property "name".

I have a global variables in my canvas app definer as Set(_name, "John Doe")

Can I set the input of my "name" property to _name?

I have tried but it seems that it does not resolve the value of the variable and breaks as _name is not a string, i.e. "_name"

Thanks!
  • Jensschroder Profile Picture
    Microsoft Employee on at
    Re: Using variables to set properties od f control

    Hi  @dinusc ,

     

    Thanks! I figured it out my self. I was doing as you describe but had a bug in elsewhere that caused unexpected behaviour.

     

    Br,

    Jens

  • Verified answer
    dinusc Profile Picture
    Microsoft Employee on at
    Re: Using variables to set properties od f control

    Hello @Jensschroder ,

    Considering that "name" is the property of your control (YourControl in example below), the following should work:

    YourControl.name=_name

    By the above, I mean: type "_name" (without quotes) in the "name" property field of your control.

    In this case, Set(_name, "John Doe") should cause your property to be set properly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 87 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

Overall leaderboard