cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shanemeisner
Resolver II
Resolver II

Set field value depending on selection from two other fields

In my app, dependent on a different selection above the cards, one of two cards will be displayed(ACHAccountCard or EFTAccountCard). For testing they are both visible right now.

Both cards have a dropdown "Account Type" field that retrieves names from a secondary list. Depending on the item they select, I retrieve the code that is used by SAP from a different column and store it in the form. 

ACHAccountCard Example:
ACHAcctType
DropDown items = Sort(Distinct(VendorDataList,AccountType),Result)

The ACHAcctCode field(Text) default =  LookUp(VendorDataList,AccountType = ACHAcctType.Selected.Result,AccountTypeCode)

EFTAccountCard dropdown is the same

EFTAcctCode = LookUp(VendorDataList,AccountType = EFTAcctType.Selected.Result,AccountTypeCode)

Both of these work to set their independent Code fields.

The issue is I have one "accttype" field that I want to be set depending on which of the two codes were set.

I have the accttype (text) field default =  If(ACHAcctCode.Text <> "-",ACHAcctCode,EFTAcctCode.Text <> "-",EFTAcctCode) but it never sets the value based on the EFTAcctCode, even if I leave the ACHAcctCode as the default ( "-") .

In the image below you can see that ACHAccttype is "-" and the EFTAcctType = "GL..... ", and the code retrieved is "GL" But the "accttype" field is "blank":

acctvalue.png

If I select a value for ACHAcctType, then it set the field correctly:

valuecorrect.png

1 ACCEPTED SOLUTION

Accepted Solutions
shanemeisner
Resolver II
Resolver II

After trial and error I rethought what I was doing and decided to use a variable I was already setting.

in the form above the cards, I have selection controls for the method of pay, which sets a variable (varmetpay):

methodpay.png

The selection will decide what card displays to enter the payment Information.

So, for my "accttype" field that stores the code selected that will be sent to SAP, I choose to set the default value = to "varmetpay" :

If(varmetpay = "T", ACHAcctCode,varmetpay = "E",EFTAcctCode). 

and the accttype field is updated based on which acctcode is set now 🙂 

View solution in original post

1 REPLY 1
shanemeisner
Resolver II
Resolver II

After trial and error I rethought what I was doing and decided to use a variable I was already setting.

in the form above the cards, I have selection controls for the method of pay, which sets a variable (varmetpay):

methodpay.png

The selection will decide what card displays to enter the payment Information.

So, for my "accttype" field that stores the code selected that will be sent to SAP, I choose to set the default value = to "varmetpay" :

If(varmetpay = "T", ACHAcctCode,varmetpay = "E",EFTAcctCode). 

and the accttype field is updated based on which acctcode is set now 🙂 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (61,447)