Hi everyone,
I browsed the whole community, and many had the same error message but none of the solutions worked.
The situation:
I have a gallery with a sharepoint list as a data source. The field "SendFrom" is a "Person or Group" field. I am retrieving the User Name from that "Send From" field and retrieving the Office365 Profile Picture through this.
By the way I am in Germany so thats why the Office365 user syntax is different and some other syntax differences. This is the code I am using:
If('Office365-Benutzer'.UserPhotoMetadata(ThisItem.SendFrom.Email).HasPhoto=false;SampleImage;'Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email))
It shows me the profile picture. And for those that don't have a profile picture, it shows the sample image. So that works.
However I am still getting two error messages:
The method 'UserPhotoV2' has an invalid value for parameter 'id'
The method 'UserPhotoMetadata' has an invalid value for parameter 'userid'
I tried different additional approaches based on the solutions that I found here:
1. 'Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email) -->1 Error Message + However does not show sample image in case the user has no profile picture.
2. If(IsBlankOrError('Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email));SampleImage;'Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email)) --> 1 Error Message + Sample Picture will not be shown in development mode but in the app you will see it.
3. If(IsBlank(ThisItem.SendFrom.Picture);'profilepic-generic-user';If('Office365-Benutzer'.UserPhotoMetadata(ThisItem.SendFrom.Email).HasPhoto=false;SampleImage;'Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email))) --> Shows nothing. Faulty Code.
4. If(IsBlank('Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email).ID);'profilepic-generic-user';If('Office365-Benutzer'.UserPhotoMetadata(ThisItem.SendFrom.Email).HasPhoto=false;SampleImage;'Office365-Benutzer'.UserPhotoV2(ThisItem.SendFrom.Email))) ---> Shows nothing. Faulty Code
Any ideas?
Thank you so much!