sharepoint online – csom FieldUserValue.LookupValue returns the display name of the user, not the log name

In CSOM FieldUserValue.LookupValue returns the display name of the user. Alternatively, you can enter user details from the & # 39; user information list & # 39; query by passing the user ID. However, you must do this with ClientContext.ExecuteQuery (), which you want to avoid.

If you want, use REST API then you can use below

_api / web / lists / getbytitle (# listname #) / items (id)? $ select = YourUserField / Name & $ expand = YourUserField / Id

Above the endpoint URL is & # 39; Name & # 39; returned, which is similar to the login name in sharePoint online. REST is also a simple and fast way to retrieve data.