Empty field on expanded lookup columns causes error on SharePoint REST API
If we try to expand a lookup column and one of the expanded field has no data this will cause the error "Cannot get value for projected field Userx005fEMail" and will return no value.
For instance, this will return a error if one of the user email has not been initialized.
Lookups to other lists also crash if we don't fill all the expanded fields with something.
Possibly the single most painful aspect of the sharepoint REST API. Not well advertised and causes an obscure error that takes awhile to track down. It's quite common to retrieve a related record that may have null values in columns, and rather startling that the API will throw an error if you do so.
I understand CAML isn't really a substitute because of difficulties retrieving multilookup fields. Renderlistdataasstream is proposed as an alternative, but the format of the returned results is substantially different, and it looks like it truncates long field names.
I will likely have to rework to either (a) do multiple queries (not ideal given the number of lookups on my primary list) with manual joins in code, or (b) force dummy values into otherwise-empty fields (again, big yuck, and not sure it'll stick).