cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sifu
Continued Contributor
Continued Contributor

Cascading dropdown from combobox

I am working with SharePoint Online and editing a form of a list, lets call it "registration".

I have also other list, lets call it "customers" where i store name of the customer (Title), his country (Land), and town (ort)

 

In registration list, I have a Combobox, that is looking in customers for the title, its limited to one choice only (not multiple). I use it as its not limited to 500 lines and has a search feature. Once I select the customer name, i have next field Country, which will offer me choices of countries, of that particular customer (if he has more countries covered). As allowempty = false, it will populate this value very quick. Last dropdown is City, which is just like Country...

Only first one is a combobox, other 2 are dropdowns. After i submit this, all gets saved and all is fine.

 

All these 3 fields are in one card. In order to save this i have some standard fields like customer, country and city, where the property "Update" is pointing to the above mentioned combo or dropdown (like customer.Selected.Result). With this i can save it by a simple submit form request

 

The first combo has items value: Sort(Distinct('Customer Visit -CustomerList',Title),Result)

Second dropdown: Distinct((Filter('Customer Visit -CustomerList',Title=customer.Selected.Result)),Land)

Third dropdown: Distinct((Filter('Customer Visit -CustomerList',(Land='cus-country'.Selected.Result),(Title=customer.Selected.Result))),Ort)

 

The default value point to the list where these values are located so:

dropdown1 has default: Country

dropdown2 has default: City

Except for the combobox: combo has default: { Value: DataCardValue1.Text }   ...it seems that here i had to point it to the standard field and as value, otherwise it would not retrieve it.

 

The odd thing is that I can create new entry, save, i see it in the list, but if i open it in form (display form or edit form) only first combobox is displayed... before i had a classic dropdown instead of combo and it was all working fine, now ..no idea but wont.

If i open an existing entry, choose edit all, and re-select the customer, other fields will jump back in automatically, just like a new form...

 

1 ACCEPTED SOLUTION

Accepted Solutions
Sifu
Continued Contributor
Continued Contributor

i solved it by creating item values as following (for city and country)

 

If(IsBlank(DataCardValue2.Text),
Distinct((Filter('Customer Visit -CustomerList',Title=customer.Selected.Result)),Land),
Distinct((Filter('Customer Visit Registration',ID=ThisItem.ID)),Country))

 

this way it checks if there is an entry in the table by calling the field that represents it (datacardvalue2), if its empty then it will perform the classic drop down feature, if its full, it will call the same field via curentitem id.

View solution in original post

9 REPLIES 9
PowerAddict
Super User
Super User

What is the Default property of the combo box that is working when you try to view/edit a record in the form? 

 

Also what is the Default property of both dropdowns? My suspicion is that the Default property of those dropdowns isn't set to something that will force to show the selected record's values. 

 

Anyways, let me know these answers and we can figure this out. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Sifu
Continued Contributor
Continued Contributor

hi @PowerAddict , its mentioned in the description:

The default value point to the list where these values are located so:

dropdown1 has default: Country

dropdown2 has default: City

Except for the combobox: combo has default: { Value: DataCardValue1.Text }   ...it seems that here i had to point it to the standard field and as value, otherwise it would not retrieve it.

Sifu
Continued Contributor
Continued Contributor

I just tested to add a dropdown back in and do the same as the combo, then i pointed the dropdown (country) to look at this dropdown (instead of the combo) and i got immediate result! There must be some kind of trick with this Combo.

Yea I saw that, it didn't really mean anything to me, so was wondering if you could expand on that or take a screenshot of the Default properties of the 2 dropdowns. 

 

The Default property has to be dependent on the Customer value (combo box) since that is the value that always shows up when you try to view a record. So you need to do some kind of a lookup to fetch the Country and City from the Customer record. 

 

If you can take a screenshot of the form, its properties, and the details of the 2 dropdowns along with the combo box, that would be great. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Sifu
Continued Contributor
Continued Contributor

 

@PowerAddict; here are two screenshots, one is the combo, and the other country dropdown

 

(currently country default value is this item ..country, but leaving country only, as the name of the column has same effect, none...)

Sifu
Continued Contributor
Continued Contributor

I see also that if i use again Dropdown for customer, not only that other dropdowns show the value (in view mode) but the default value has no affect on them, which is weird, it seems as if they always calculate based on previous choice... this could be another problem...

Apologies for asking this but do the following steps outline your situation? 

 

1. You have a combo box for customers and 2 dropdowns for Country and City

2. The dropdowns are filtered based on the customer selected

3. When creating a new record, the values are all captured fine

4. When displaying a record in a form, you do not see values for Country and City

5. The default properties of the two dropdowns are ThisItem.Country and ThisItem.City

6. Can you tell me what the Default property of the combo box is? 

 

Let me know. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Sifu
Continued Contributor
Continued Contributor

@PowerAddict 

1. You have a combo box for customers and 2 dropdowns for Country and City YES

2. The dropdowns are filtered based on the customer selected YES

3. When creating a new record, the values are all captured fine YES

4. When displaying a record in a form, you do not see values for Country and City YES

5. The default properties of the two dropdowns are ThisItem.Country and ThisItem.City...this was a test, they should be just "Country" and just "City"... thats how this usually worked for me

6. Can you tell me what the Default property of the combo box is? currently its working with { Value: Customer }, but it was before working also with { Value: DataCardValue1.Text }

 

Sifu
Continued Contributor
Continued Contributor

i solved it by creating item values as following (for city and country)

 

If(IsBlank(DataCardValue2.Text),
Distinct((Filter('Customer Visit -CustomerList',Title=customer.Selected.Result)),Land),
Distinct((Filter('Customer Visit Registration',ID=ThisItem.ID)),Country))

 

this way it checks if there is an entry in the table by calling the field that represents it (datacardvalue2), if its empty then it will perform the classic drop down feature, if its full, it will call the same field via curentitem id.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,109)