Issue with getUserByID Function After Migrating SharePoint List to SharePoint Online - LookupId and UserInfoList mismatch

Kamil Plonka 20 Reputation points
2024-12-12T13:04:35.4866667+00:00

Background: We have successfully migrated a SharePoint List from SharePoint 2016 to SharePoint Online. The SharePoint Online list includes custom New, Edit, and View forms that utilize the getUserByID function (https://learn.microsoft.com/pl-pl/dotnet/api/microsoft.sharepoint.client.web.getuserbyid?view=sharepoint-csom).

Problem: When an item is edited, the getUserByID function fails to match the user within the UserInfoList, resulting in an error.

Findings:

During the migration, the "Created by" and "Modified by" fields were also migrated, containing user metadata.

Retrieving these values using the following PowerShell command:

powershell

$Item = Get-PnPListItem -Id 1 -List "SampleList"
$Item["Author"]

The getUserByID function retrieves the user ID, but it cannot find a match in the UserInfoList (https://xyz.sharepoint.com/sites/sitexyz/_layouts/15/people.aspx?membershipgroupid=0).

Question: How can we resolve this user ID mismatch issue?

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,768 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 30,626 Reputation points Microsoft External Staff
    2024-12-16T09:01:35.2466667+00:00

    Hi @Kamil Plonka ,

    Got it. I did a lot of research, but unfortunately, I didn't get any useful information. Maybe you need to check the backend. But the forum permissions are insufficient, so we suggest you open a ticket. The support team over there has the correct escalation channel, they can involve more resource and investigate the behavior from back end as fast as possible. They also can check the behavior on your end remotely. For reference: Get support - Microsoft 365 admin | Microsoft Docs

    Good day!


    If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 30,626 Reputation points Microsoft External Staff
    2024-12-13T09:20:06.5533333+00:00

    Hi @Kamil Plonka ,

    Hi, welcome to Q&A forum!

    What tool did you use to perform the migration? SPMT or something else? Have you checked that the Active Directory account has been correctly synchronized to the Microsoft Entra ID? I suggest going to the Microsoft Entra admin center to check.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.