cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Isatol
Level: Powered On

How to change the Text of a text box when changes the drop down value

Hi. 

 

I need to change the text of a text box when the drop down change his value. For example:

Captura8.JPG

When the dropdown says "Completado", the Text of DataCardValue4 it will be 100. In the OnChange action of the dropdown i have a function, but it doesn't work.

 

How can i make the text box change to 100?

 

Thank You

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: How to change the Text of a text box when changes the drop down value

@Isatol

 

You will need to use a variable for the text property and then use UpdateContext.

 

So, set the Text propert of DataCardValue4 to say - SampleNumber and then set the OnChange action of dropwdown to 

 

If(dataCardValue7_2.Selected.value = "Completado";UpdateContext({SampleNumber:"100"}))

 

Hope this helps!


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sru
Level 8

Re: How to change the Text of a text box when changes the drop down value

Hi,

 

set text box control default value with below syntax

 

If(Dropdown1.Selected.Value="2",TextInput1.Text="100")

c1.PNG

 

c2.PNG

Thanks,

Sru

 

6 REPLIES 6
Isatol
Level: Powered On

Re: How to change the Text of a text box when changes the drop down value

i forgot to say that the format type of the text box is numeric

Super User
Super User

Re: How to change the Text of a text box when changes the drop down value

@Isatol

 

You will need to use a variable for the text property and then use UpdateContext.

 

So, set the Text propert of DataCardValue4 to say - SampleNumber and then set the OnChange action of dropwdown to 

 

If(dataCardValue7_2.Selected.value = "Completado";UpdateContext({SampleNumber:"100"}))

 

Hope this helps!


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User
Super User

Re: How to change the Text of a text box when changes the drop down value

@Isatol

 

as you said teh format of textbox is numeric , you can try this if the other one doesn't work

 

If(DataCardValue7_2.Selected.value = "Completado";UpdateContext({SampleNumber:100}))


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sru
Level 8

Re: How to change the Text of a text box when changes the drop down value

Hi,

 

set text box control default value with below syntax

 

If(Dropdown1.Selected.Value="2",TextInput1.Text="100")

c1.PNG

 

c2.PNG

Thanks,

Sru

 

Isatol
Level: Powered On

Re: How to change the Text of a text box when changes the drop down value

Thank You so much, your answer has helped me Smiley Very Happy

MickThornton
Level: Powered On

Re: How to change the Text of a text box when changes the drop down value

Thanks!  I needed the .Selected.Value part to solve my problem.