web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combobox (MS Lookup) w...
Power Apps
Answered

Combobox (MS Lookup) with PATCH gives Network Error, if DefaultSelectedItems not manually removed

(0) ShareShare
ReportReport
Posted on by 177

Greetings,

 

I have a multiple-select combobox (Produkte_cmb) for Sharepoint Multiple-Select Lookup column Produkte which is dependant on the SelectedItems of another multiselect combobox (Produktlinien cmb). Produkte is looking up the List Produkte PLA with two columns - Produkt Src (this is the value column for Produkte) and ProduktlinieRef which is used as reference to the parent combobox Produktlinien_cmb for the preselection.

 

Items property of combobox Produkte_cmb is set to:

Ungroup(
 ForAll(
 Produktlinien_cmb.SelectedItems As _Sel,
 Filter(
 'Produkte PLA',
 ProduktlinieRef.Value in _Sel.Value 
 )
 ),
 "Value"
)

 

DefaultSelectedItems is set to Parent.Default

 

Update property of corresponding datacard is set to Coalesce(Produkte_cmb.SelectedItems)

 

The lookup column itself is populated via PATCH function set currently in the OnSelect property of the Save & Submit button of the Edit form before SubmitForm action. The code is as follows.

 

ForAll(
 Produkte_cmb.SelectedItems,
 Collect(
 colProdukte,
 {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id: ID,
 Value: ProduktSrc
 }
 )
);
atch (
 ELN,
 LookUp(
 ELN,
 ID = varSelectedListItemID
 ),
 {
 Title: varThisItem.Title,
 Produkte: colProdukte
 }
);

  

Observations:

 

  • If column Produkte is empty, everything works nicely - Produkte_cmb gets populated, Form saves on submit, Values are saved in the column Produkte appear in the Produkte_cmb upon reopening of the form
  • If column Produkte already has values following unwanted behaviours are observed:
    1. Existing values are not recognized by combobox being same as new ones - e. g. if entry A exists and another entry A is selected, two entries A are populated. Another selection of A removes the second new! entry A.
    2. If all (!) existing values are not manually removed, saving of the form results in following error: 

Nuriel_0-1698088643349.png

The form gets canceled and no changes are saved.

               3. If all (!) existing values are manually removed - see 1, everything works again.

 

Any idea, how to tackle this issue?

 

Thank you!

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Nuriel ,

     

    The root cause of this issue is DefaultSelectedItems result is not matching the table of Items property of the Combo box. Since it's a LookUp column allows multiple selections, Parent.Default is with below structure:

    [
    {Id:..., Value:...},
    {Id:..., Value:...},
    {Id:..., Value:...},
    {Id:..., Value:...},
    ...
    ]

     

    But Items table using the UnGroup function includes all columns of the 'Produkte PLA' list. To solve the issue, you can try and modify the formula in DefaultSelectedItems:

    ForAll(ThisItem.Produkte, LookUp('Produkte PLA', ProduktlinieRef.Value = ThisRecord.Value))

    The ForAll function will return a table from Produkte PLA list, includes exact same columns as table in Items.

     

    Best regards,

  • Nuriel Profile Picture
    177 on at

    Hi,  @v-jefferni 

    thanks a lot for your suggestion.

     

    I have tried to use it, but it didn't work directly, so I had to modify it somewhat:

     

    • ThisItem.Produkte exchanged with varThisItem.Produkte (my App gets ID passed from an integrated form, thus ThisItem and ThisRecord do not work unfortunately)
    • ProduktlinienRef can't be used here, because there is no relationship from this column to the Produkte column here - the value of Produkte corresponds to ProduktSrc single text column column in 'Produkte PLA".
    • ThisRecord.Value I wanted to substitute by varThisItem.Value which weirdly gave error all the time, so I tried just using Value and it worked 

       

      In the end I came up with the following :

       

     ForAll(varThisItem.Produkte, LookUp('Produkte PLA', Value = ProduktSrc)) 

     

    So far everything seems to work correctly, I will need to run more tests for all special cases I have in my app, but for now I see that:

     

    • Previously saved items are loaded correctly and are being recognized as lookup values correctly
    • When I click on them, they get removed, no new copies are populated
    • New items can be added and after saving/submitting and patching, everything gets properly saved without any error and without the need to remove previous items first.

      So I hope that was it.

       

      Thanks a lot for bringing me on the right track!!!  

      Best Regards 👍

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard