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

Cascaded dropdown - default value set at edit form

Hi All,

 

i have implemented cascaded dropdowns with lookup fields as below-

1. field-A - sharepoint lookup field

2. field-B - sharepoint lookup field

field-A and field-B both are coming from a lookup list say lookupAB. 

 

In power app- created dropdown controls rather than using field-A and field-B comboboxes. 

1. ddlfieldA

2. ddfieldB

 

cascaded feature is implemented and working fine on new and edit forms in power app. 

 

Issue- 

when i goes to edit item, NO selection found. i can see saved value in sharepoint list but its not showing as default selected in edit form. 

 

can someone please suggest what could be possible fix to populate default values in ddfieldA drop down OR its not possible due to cascaded. 

 

please help.

 

Thanks 

Amod

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @amodtiwari,

Set the Default property of the ddlfieldA as below:

 

ThisItem.FieldA.Value

Set the Default property of the ddfieldB as below:

 

LookUp(CollookupAB,Title=ddlfieldA.SelectedText.Value).field-B
Best Regards,
Qi

View solution in original post

3 REPLIES 3
v-qiaqi-msft
Community Support
Community Support

Hi @amodtiwari,

Do you want to set the default selected value for the ddfieldA?

Could you please tell me that how you set the Items of the ddfieldA and ddfieldB?(IMPORTANT)

If you want the dropdown display the default value when you edit an existing record, you should set the Default property of the Dropdown based on the Items property you set for it.

I have a test on my side, please take a try as below.

I have 2 LookUp fields, FieldA and FieldB in my Product list which retrieves values from the lookupAB containing 2 text columns named AColumn and BColumn.

1). Set the Items property of the ddlfieldA as below:

Choices([@Product].FieldA)

Set the Default property of the ddlfieldA as below:

ThisItem.FieldA.Value

Set the AllowEmptySelection property of the ddlfieldA as true

2). Set the Items property of the ddlfieldB as below:

Choices([@Product].FieldB)​

Set the Default property of the ddlfieldB as below:

LookUp(lookupAB,AColumn=Dropdown3.Selected.Value).BColumn // Dropdown3 represents the Dropdown corresponding to FieldA

Set the AllowEmptySelection property of the ddlfieldB as true

Best Regards,
Qi
amodtiwari
Helper II
Helper II

Hi,

 

Thanks to looking into case, i am using collection to get values under these two lookups - 

 

Items properties-

1. ddlfieldA  - Distinct(CollookupAB,Title)

2. ddfieldB - Distinct(Filter(CollookupAB, Title = ddlfieldA .SelectedText.Value), field-B)

 

it working for cascaded feature but the problem is to set default value of ddlfieldA  on edit form. 

 

please let me know in case of any query.

 

Thanks

Amod

Hi @amodtiwari,

Set the Default property of the ddlfieldA as below:

 

ThisItem.FieldA.Value

Set the Default property of the ddfieldB as below:

 

LookUp(CollookupAB,Title=ddlfieldA.SelectedText.Value).field-B
Best Regards,
Qi

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,976)