Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

(0) ShareShare
ReportReport
Posted on by 4

Hi. Can someone please assist me with this issue? I've only been using power apps for a week now and I feel as if I've hit a wall:

Context:

I have three SharePoint lists:

IMMMatters (the main list), relevant data includes:

Matter Name - Title Field

OrgName - Lookup to IMMOrgs OrgName (single select)

Attorneys - Lookup to IMMAttorneysOrgs (multi select)

IMMOrgs (list of all client organizations)

OrgName - Title Field (name of client organization)

ClientNumber 

IMMAttorneysOrgs (used to indicate which attorneys do work for which clientorganizations); includes:

AttorneyInfo - Title field containing a description of the attorney including name and role- used for attorney lookups.

Organization - Lookup to OrgName in IMMOrgs

The form I am creating in Power Apps is for viewing/adding/editing members of the IMMMatters list. It looks like this:

rishey_0-1716997256708.png

All of the fields in this form work as one would expect except for Attorney, which is a combo box that allows the user to select multiple attorneys from IMMAttorneysOrgs, but the Items are filtered such that this combo box only displays the attorneys in which Organization in IMMAttorneysOrgs = The organization selected in this form.  This filter does appear to work properly. It only displays the attorneys with the correct organization in the combo box. The formula I am using for Items on this attorneys combo box is:

 Filter(
 IMMAttorneysOrgs,
 Organization.Value = OrgCardValue.Selected.Value
 )

The problem I am having arises when I go to edit a record in IMMMatters, if I want to change the members of the attorneys combo box. If I unselect all members and save, that works fine. However, if I attempt to change some of the selected members and save, that's when I get a PATCH ERROR (502).

 

This is what the Update property contains on the Attorneys data card:

ForAll(
 DataCardValue2.SelectedItems,
 {
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Id: ID,
 Value: Title
}
)

Can someone please shed some insight as to how I can solve this problem?

Thanks in Advance,
Richard 

 

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

    Hi @rishey ,

     

    All right, slightly different approach where you add the Organization.Value to the Choices(IMMMatters.Attorneys), use it to filter by and then remove it:

    DropColumns(
    	Filter(
    		AddColumns(
    			Choices(IMMMatters.Attorneys),
    			vOrg,
    			LookUp(
    				IMMAttorneysOrgs,
    				Title = Value,
    				Organization.Value
    			)
    		),
    		vOrg = OrgCardValue.Selected.Value
    	),
    	vOrg
    )

     

    In theory you should be able to set the Attorneys_DataCard.Update property to DataCardValue2.SelectedItems with this.

  • rishey Profile Picture
    4 on at
    Re: PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

    same Issue, I'm afraid. 

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

    Hi @rishey ,

     

    Apologies, I missed the filter part.

     

    Please try including a reference to ThisRecord then:

    ForAll(
     DataCardValue2.SelectedItems,
     {
     Id: ThisRecord.ID,
     Value: ThisRecord.Title
     }
    )
  • rishey Profile Picture
    4 on at
    Re: PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

    Thanks but that didn't work. I mean it works if I leave it vanilla but I need the box to filter based on organziation and when I do that as described above with the Filter command, then the update no longer works, so i had to customize it with the ForAll loop, which causes the PATCH error when I attempt to update the selections. 

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: PowerApps SharePoint Form: unable to alter selected items in filtered lookup combo box

    Hi @rishey ,

     

    Try deleting the Attorneys DataCard and then add it back.

     

    I think that will resolve all your issues since it will reset the DataCardValue2.Items property to Choices(IMMMatters.Attorneys) and Attorneys_DataCard.Update property to DataCardValue2.SelectedItems.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard