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:
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
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.
same Issue, I'm afraid.
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
}
)
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.
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.
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional