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

Setting a DropDown Default value based on filtered Dropdown selection

I have a form where users enter Vendor Address and Payment Address. Most times they are the same so I want to set the Default value for the Payment fields to equal the Vandor Address. My formula is working for Text fields and all but one dropdown.

Example: For the Payment Vendor Name, the Default = If(SharePointForm1.Mode = New,If(VenPayAdd.Selected.Value = "Yes",VenName1.Text,""),ThisItem.'Payment Vendor Name 1')
Where VenPayAdd is the selection of the Payment address being the same or not. By Default that is Yes and all text fields are working as expected.

The Vendor Country(VenContrydd) is a DropDown selection from a secondary list: Sort(Distinct(VendorDataList,Country),Result)
The Country Payment Dropdown default is working with this Formula:
If(SharePointForm1.Mode = FormMode.New,If(VenPayAdd.Selected.Value = "Yes",VenContrydd.Selected.Result,"-"),ThisItem.PayVenCountry)

Where I am running into an issue is that the Vendor State Dropdown(VenStatedd) is a Filtered Dropdown selection from that secondary list depending on the Country selected : Filter(VendorDataList, Country = VenContrydd.Selected.Result)
When I get to the Payment State field, it doesn't like the Filtered data result as a "selected result":

If(SharePointForm1.Mode = FormMode.New,If(VenPayAdd.Selected.Value = "Yes",VenStatedd.Selected.Result,"-"),ThisItem.PayVenState)
"Result" gives "Identifier not recognized".. When I enter the "VenStatedd." I get options of "Selected" and "SelectedText" but both give errors when selected.
In the screenshot below you can see that currently the Payment State is being set to the first filtered value (AL) rather then what I selected in the Vendor State.. Whereas the Payment Country dropdown is the same as the Vendor Country..

paymentcntry.png

1 ACCEPTED SOLUTION

Accepted Solutions
Resolver II
Resolver II

Figured this out by using another field I had in the App.
To pass the Value of the Vendor State selected by the user back to SAP, I had created a Text field named "VenState" which has a default value of: VenStatedd.SelectedText.Value

So, for the Payment State Default I used that field value if it is a new item being created:
If(SharePointForm1.Mode = FormMode.New,If(VenPayAdd.Selected.Value = "Yes",DataCardValue36.Text,"-"),ThisItem.PayVenState)

And Viola.. If they leave "Payment is the same as vendor" as "Yes" then the Payment State defaults to the Vendor State:

paymentcntry.png

View solution in original post

3 REPLIES 3
Resolver II
Resolver II

Figured this out by using another field I had in the App.
To pass the Value of the Vendor State selected by the user back to SAP, I had created a Text field named "VenState" which has a default value of: VenStatedd.SelectedText.Value

So, for the Payment State Default I used that field value if it is a new item being created:
If(SharePointForm1.Mode = FormMode.New,If(VenPayAdd.Selected.Value = "Yes",DataCardValue36.Text,"-"),ThisItem.PayVenState)

And Viola.. If they leave "Payment is the same as vendor" as "Yes" then the Payment State defaults to the Vendor State:

paymentcntry.png

View solution in original post

Hi @shanemeisner ,

Have you solved your problem?

Is the "State" column a Text type column in your list?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

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

Thanks for the reminder.. The State field was a text field that holds the value needed to send over to SAP and I marked my answer as the solution that worked. 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,431)