I am assuming here you are wanting to update the
Retention SharePoint list with the contents of the
galCurHRBP gallery. Assuming you have the
ID of the relevant record in the Gallery
Items, try this structure. I also assume that you have a field called
Value in your gallery containing a valid email address.
Patch(
Retention,
ForAll(
galCurHRBP.AllItems As _Data,
With(
{
_ID:
LookUp(
Retention,
Assigned_to_HRBP.Email = _Data.Value,
ID
),
_User: Office365Users.UserProfileV2(_Data.Value)
},
{
ID: _ID,
Assigned_to_HRBP:
{
Claims: "i:0#.f|membership|" & Lower(_Data.Value),
Department: _User.department,
DisplayName: _User.displayName,
Email: _Data.Value,
JobTitle: _User.jobTitle,
Picture: ""
}
}
)
)
);
Refresh(Retention);
There are a couple of important things here to note - firstly you do not need the odata.type reference anymore, but more importantly the structure of having the ForAll statement inside the Patch, which is farm more efficient/faster as it writes the resulting Table in a single Patch, rather than a data source write for each record.
Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
MVP (Business Applications) Visit my blog Practical Power Apps Buy me a coffee