SharePoint SPFx & integration: Choosing the right user identifier for external system relationships
User attribute mapping for an external system relationship When building SharePoint-integrated applications—such as a Shop system embedded via SPFx in SharePoint — we often face a subtle but critical challenge: how to reliably link a user to data stored in an external system. A typical example is assigning orders to the user who created them. At first glance, this seems straightforward— until user properties start changing . 😒 In SharePoint Framework (SPFx), the current user is available via this.context.pageContext.user . This object exposes several properties like displayName , email , id , and loginName . However, not all of these are suitable for use as a stable foreign key in an external database. Properties such as displayName and email are mutable. If an administrator updates these values in Entra ID or SharePoint, the changes will eventually propagate—but not instantly. Synchronization delays and site-specific caching (via the User Information List) can lead to temporary inc...