@MS-29011540-0
No, there is no officially supported way in X++ to differentiate between an OData call from Open in Excel versus an external API call.
Both routes hit the same /data/ OData endpoint using the Microsoft Dynamics Office Add-in and standard OAuth/Entra ID authentication. X++ session introspection classes like xSession or SysHttpHeaders do not expose a distinct flag or user-agent string that safely isolates the Excel Add-in from a Postman or external C# application using the same credentials.
Two practical workarounds if you need source tracking:
1) Expose a Custom Service endpoint using [SysODataActionAttribute] for your external integration — design the contract to include an explicit tracking parameter your external app passes. The Open in Excel path will never hit this endpoint.
2) Use a separate dedicated data entity mapped exclusively for the external integration versus the one exposed for Open in Excel — this gives you entity-level differentiation in your logs.
Hope this helps.