Announcements
I am using a sharepoint list as a datasource and I want to delete a single person in the column only if
the person' name isnt mentioned in the combo box of the edit screen.
I currently have this formula:
RemoveIf( AttachmentParticipants, CID = locCurrentRecord.ID );
for example. my list has a column named "Participants" and its a multi select person or group column
in the list I have ID = 200 and person named Winter and Snow.
in the edit screen the user plans to edit the person to Winter and Happy. That means in the "Participants" column I have to remove Snow and retain Winter.
How do I do this?
I have another list which I did something similar but, in this list, the Participants is not multi select meaning it creates an item per participant. In this formula what I did was check if the person mentioned in the list is in the select items of the edit screen's combo box then remove that list item if it doesn't.
ParticipantsResponse and AttachmentParticipants are different lists.
ForAll( //ClearCollect(colExistingParticipant, Filter(ParticipantResponse, cID= locCurrentRecord.ID)); colExistingParticipant As ExistingParticipant, If( //if review participants select in combobox is not existing in the filtered participantcontractresponse list Not( ExistingParticipant.Participant.DisplayName in ForAll( ReviewParticipantsDataCardValue7_Edit .SelectedItems, DisplayName)), //condition RemoveIf( ParticipantResponse, cID= ExistingParticipant.ContractID && (Participant.DisplayName = ExistingParticipant.Participant.DisplayName) ); ); );
ForAll(
colExistingAttachmentParticipant As _Item,
With(
{
_Current: LookUp(
ExistingParticipant,
ID = _Item.ID,
Participant
),
_New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
},
With(
{
_Update: Ungroup(
ForAll(
_Current As _C,
Filter(
_New,
_C.Email in Email
)
),
Value
)
},
Patch(
ExistingParticipant,
{
ID: _Item.ID,
Participant: ForAll(
_Update As _U,
{
Claims: _U.Claims,
Department: _U.Department,
DisplayName: _U.DisplayName,
Email: _U.Email,
JobTitle: _U.JobTitle,
Picture: _U.Picture
}
)
}
)
)
)
)
With(
{
_Current:
LookUp(
colExistingAttachmentParticipant,
ID = locCurrentRecord.ID,
ReviewParticipants
),
_New: ReviewParticipantsDataCardValue7_Edit.SelectedItems
},
With(
{
_Update:
Ungroup(
ForAll(
_Current As _C,
Filter(
_New,
_C.Email in Email
)
),
Value
)
},
ForAll(
colExistingAttachmentParticipant As CurrentAttachmentItem,
UpdateIf(
AttachmentParticipants,
ContractID = CurrentAttachmentItem.ContractID && (Title = CurrentAttachmentItem.Title),
{
ReviewParticipants:
ForAll(
_Update As _U,
{
Claims: _U.Claims,
Department: _U.Department,
DisplayName: _U.DisplayName,
Email: _U.Email,
JobTitle: _U.JobTitle,
Picture: _U.Picture
}
)
}
)
)
)//attachment participant patching inner with end bracket
);//attachment participant patching outer with end bracket
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.