cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smerchant
Helper I
Helper I

Cascading Combo Box with Filter based on Lookup Fields

I am trying to create a cascading combox box (multiple select) based on the look up field and I can't seem to get this working.  Any guidance /help would really helpful.

 

 

I need to cascade Demises based on the Property selected.  In this list both Property and Demise are the lookup fields coming from two different lists.

 

I tried to created a custom combo box but getting an error.  It worked once when I provivded field.Id instead of Value but now it is not working.  

 

cascading isuue.png

 

It is working with the dropbox list (single value select) but giving the same error (cannot be evaluated remotely..).  I need a combo box or lis to select multiple values.

 

Also, how do I save the values back to the list.  Thanks

 

 

2 REPLIES 2
v-monli-msft
Community Support
Community Support

 

Hi @smerchant,

 

I think your requirement to update multiple selected lookup column with Filter based on Lookup fields cannot be achieved. But I think it could be achieved with single selection.

 

May I know where did you get the information of these 2 Lookup columns? Is it from the same SharePoint list or another one? If it is from another list, please also add this list to the data source list in the app. In my example, the source list name is List_Test and the list to update is List.

 

1. Add a dropdown1 control, set its Items property to:  List_Test  Value to: Name

2. Add another dropdown2 control, set Items property to:

 

Filter(List_Test,Name=Dropdown1.Selected.Value).Title

 

Then, in Dropdown2 control, it will only shows the value from Name column with Filter based on dropdown1.

3. To update List lookup column with dropdown 2, you will need to use Patch function. 

 

Patch(List,
         Defaults(List),
        {Lookup:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                        Id:Dropdown2.Selected.ID,
                        Value:Dropdown2.Selected.Title}
              }
         )

 

 

For patch usage with lookup field, we need to patch a record rather than a value. And this is the part that multiple selected lookup won't work. The Record must match the Schema defined under your lookup field. 

 

 

Another thread for reference:

Manually set lookup column in new SharePoint list item

 

Regards,

Mona

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

Thanks  for this @v-monli-msft.  The data is coming from the SharePoint lists.  For example, List B has a Look up from List A.  List C has a lookup from List B. I am trying to customise List C form where there are two look up columns (from List B). 

 

I think what you are suggesting is that I should use 2 custom dropdown controls and get the data directly from List A and B and then apply the filter?

 

Also, am I correct that for Pitching I would need a custom Save button?

 

Thanks,S

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,779)