cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

Using variables to set properties od f control

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!
1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

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.

View solution in original post

2 REPLIES 2
Microsoft
Microsoft

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.

View solution in original post

Highlighted
Microsoft
Microsoft

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Users online (5,731)