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 / Patch SharePoint Perso...
Power Apps
Answered

Patch SharePoint Person/Group column with LookUp

(0) ShareShare
ReportReport
Posted on by

Hello community,

 

I have a problem when trying to Patch a SharePoint Person/Group column based on LookUp from another SharePoint List.

 

LookUp Sharepoint List:

FilipC2_1-1716285065721.png

Basically the users of the application are selecting in a ComboBox the 'HUB' and based on that selection the Patch function should write in the second SharePoint which is the data base of the application in another Person/Group  the responsible Manager of selected HUB.

 

Formula used:

 Patch(
 'SSH Task Management',
 Defaults('SSH Task Management'),
 {
 Title: Combo_Cluster.Selected.Result,
 OpCo: Combo_OpCo.Selected.Result,
 Brewery: Combo_Brewery.Selected.Result,
 Requester: Combo_Requester.Selected,
 ContactPerson: Combo_Contact.Selected,
 Reason: Combo_Reason.Selected.Result,
 TypeOfRequest: Combo_TypeReq.Selected.Result,
 AreaOfSupport: Combo_AreaSupp.Selected.Result,
 Hub: Combo_Hub.Selected.Result,
 HubManager: {
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.f|membership|" & LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.Claims),
 Department: LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.Department),
 DisplayName: LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.DisplayName),
 Email: LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.Email),
 JobTitle: LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.JobTitle),
 Picture: LookUp('HUB Managers', HUB = Combo_Hub.Selected.Result, Manager.Picture)
 },
 Department: Combo_Department.Selected.Result,
 LossesType: Combo_Losses.Selected,
 ExpectedStartDate: DatePicker_StartDate.SelectedDate,
 ExpectedEndDate: DatePicker_EndDate.SelectedDate,
 SupportType: Combo_SuppType.Selected,
 ShortDescription: TextInp_ShortDesc.Text,
 FullDescription: TextInp_Desc.Text,
 RelatedKPI: Combo_RelatedKPI.Selected.Result,
 YTDKPIValue: TextInp_ytdKPI.Text,
 KPITarget: TextInp_KPItarget.Text,
 UoM: TextInp_UoM.Text
 }, Attachments_Form.Updates
)

The 'HubManager' part in the formula is not functioning properly and when Patch button is pressed I'm receiving error:

FilipC2_2-1716285747923.png

If I'm removing the 'HubManager' part, the rest of the fields are patching accordingly without any error.

 

At some point I managed to get it to work, but for some unknown reasons and without modifying anything (not with the same formula), after several days it stopped working.

 

Any help would be greatly appreciated.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @FilipC2 - The LookUp function can also return a Record, not just an attribute of the Record.

     

    In your scenario, I do not see any reason you cannot Patch the HubManager people field with a Record.

     

    For example, see if the example below works for you on its own:

     

    Patch(
     'SSH Task Management',
     Defaults('SSH Task Management'),
     {
     Title: Combo_Cluster.Selected.Result,
     HubManager: LookUp(
     'HUB Managers',
     Hub = Combo_Hub.Selected.Result,
     Manager
     )
     }
    )

     

  • FilipC2 Profile Picture
    on at

    Hi @Amik,

    Thank you for your reply.

     

    I have tried as a test to do the patch as you suggested only with that field and no result.

    There was no error showing, but the column was not patched - the record is blank.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @FilipC2 - could you apply the below onto a Label control and confirm a output is being returned?

     

    LookUp(
     'HUB Managers',
     Hub = Combo_Hub.Selected.Result,
     Manager.Email
     )
  • FilipC2 Profile Picture
    on at

    Hi @Amik,

     

    Yes, output is being returned.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @FilipC2 - then the formula should work. If you created a different People column in your list and attempted the same formula, does it fail too?

     

    As another test, create a ComboBox or Dropdown control in your app and update the Items property with something along the lines of:

     

    Choices([@'SSH Task Management'].HubManager)

     

    And then apply the below to the OnSelect property of a Button control:

     

    Patch(
     'SSH Task Management',
     Defaults('SSH Task Management'),
     {
     Title: "Test",
     HubManager: Dropdown1.Selected
     }
    )

     

    I am trying to establish if there is some undetermined problem with that People column.

     

  • FilipC2 Profile Picture
    on at

    Hi @Amik,

     

    I tried to remove the column from the SharePoint and re-add it and same error is showing.

    I have also tried the test that you suggested and Title it is being patched, but 'HubManager' is still empty.

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @FilipC2 - did you attempt to do what I suggested and try that code on a different People field? (so create a new People column and try the code on that field instead).

  • FilipC2 Profile Picture
    on at

    @Amik,

     

    Yes I have just tried that now, same error. Any other thoughts ?

     

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @FilipC2 - yes, please you take a screenshot of the settings for that field (via List Settings).

  • FilipC2 Profile Picture
    on at

    @Amik - there you go

    FilipC2_0-1717018384541.png

     

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 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard