cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to show/hide form fields and copy values based on result from another form field

Hi there,

 

Checking the community haven't seen a solution to this specific setup, even though this seems like a simple problem.

 

I am using SharePoint for my data. All of this takes place in a tabbed form which shows or hides fields according to selected buttons (which set up a variable) using this formula:

 

ButtonName.DisplayMode = DisplayMode.Disabled

 

 

The specific situation here I have a series of Address and then Payment Address fields. There is also a "Payment Same as Address" choice field with yes/no values.

 

What I would like is:

 

  1. The default values of the Payment fields are the same as the Address fields. So for example I have 'County' and 'Payment Country'. When country is filled out, I'd like payment country to be the same until changed.
  2. When 'yes' is selected, the Payment fields are not visible on the form no matter what tab is selected.
  3. If 'no' is selected, the Payment fields are visible on the form, but only when the address tab is selected.

 

Thank you for your time.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to show/hide form fields and copy values based on result from another form field

Hi @BarvoDelancy ,

1\Could you tell me:

1)what is the data type of Payment field and the Address?

2)what controls do you use to  fill in these two fields?

3)do you always firstly fill in Address field, then change Payment field?

I assume that both of them are text type and use textinput to fill in data.

                      you always firstly fill in Address field, then change Payment field.

If so, you could set Payment Textinput's Default:

Addresstextinputname.Text

set Payment datacard's Update:

If(Paymentdatacardname.Visible,Paymenttextinputname.Text,Addresstextinputname.Text)

 

2\3\

Could you tell me what control do you use to update "Payment Same as Address" field?

I assume that you use a drop down to choose yes/no for "Payment Same as Address" field.

If so, you should set like this:
1)Payment datacard's Visible:

If(
Payment Same as Address dropdownname.Selected.Value="no"&&addresstab_value,
true,
false)

 2)set  address tab's OnSelect:

Set(addresstab_value,true)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Impactful Individual
Impactful Individual

Re: How to show/hide form fields and copy values based on result from another form field

Try setting value of paymentCountry to addressCountryInput.Value

 

on your button tabs onselect: Set(varActiveSection, Self.Text)

 

on payment group/section visible: varActiveSection = "Address" && CheckBox1.Value

 

Highlighted
Community Support
Community Support

Re: How to show/hide form fields and copy values based on result from another form field

Hi @BarvoDelancy ,

1\Could you tell me:

1)what is the data type of Payment field and the Address?

2)what controls do you use to  fill in these two fields?

3)do you always firstly fill in Address field, then change Payment field?

I assume that both of them are text type and use textinput to fill in data.

                      you always firstly fill in Address field, then change Payment field.

If so, you could set Payment Textinput's Default:

Addresstextinputname.Text

set Payment datacard's Update:

If(Paymentdatacardname.Visible,Paymenttextinputname.Text,Addresstextinputname.Text)

 

2\3\

Could you tell me what control do you use to update "Payment Same as Address" field?

I assume that you use a drop down to choose yes/no for "Payment Same as Address" field.

If so, you should set like this:
1)Payment datacard's Visible:

If(
Payment Same as Address dropdownname.Selected.Value="no"&&addresstab_value,
true,
false)

 2)set  address tab's OnSelect:

Set(addresstab_value,true)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,530)