Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
1.8k views
in Power Apps by 2 2 3
edited by

New to Powerapps and everything coding.I want a Textinput1 box (in screen2) to display a date based on 1 of the 2 button selection(in screen1).

so...

  • If Button1 is selected I want the Textinput1 box text to display DatePicker.SelectedDate.
  • If Button2 is selected I want the Textinput1 box text to display Gallery2.Selected.DATE.

I have tried various ways but not getting anywhere. Any suggestions or help would be much appreciated.


1 Answer

1 like 0 dislike
by 29 53 84

Welcome to PowerApps,
In your case, You can use variables, as I understood you worked on 2 screens so you have to create a global variable

  1. Create a global variable using the set function for example the variable name will be "Inputvar1" then write this formula in the OnStart property of the app

    Set(Inputvar1,"text")
    

set function n power apps
2. In the default property "or the text property" of your textinput set it with the variable, "just write the variable name"
3. in the Onselect property of your button update the value of the variable with your formula that you want the button to do.

For example in the Onselect property of the button write the formula

set(Inputvar1,DatePicker.SelectedDate}) 

DatePicker.SelectedDate PowerApps

Finally, if you want to navigate to screen2 add this to the previous formula and you will see that the text updated with your variable

If you don’t ask, the answer is always NO!
...