Hi,
I have created a collection(UserPhoto) to collect user photo from Office365 Profile.
Now for People who do not have photos in Office365 Profile, I'm using add image option to upload photo.
I have set a variable (PhotoToUpload) to get the uploading image and using patch option to add it to the UserPhoto collection.
Patch(UserPhoto,LookUp(UserPhoto,UserId = MyUserId),{Photo:PhotoToUpload});
But the issue I have is, It changes the photo that I collected from Office365 Profile.
I need help to find a way to patch the photo only if there are no photos in the collection.
Solved! Go to Solution.
Hi @Venkat_Veda ,
Do you want to add a photo if the person does not have a photo.
I assume that:
1. Your Patch formula is correct,
2. “MyUserId” in your formula is the ID got from Office365, like below format(otherwise you need to get the userID from Office365 first):
If yes, based on your formula, you can add below condition to judge if this user already has a photo. This time Patch function will only work when the people doesn’t has a photo:
Patch(UserPhoto,If(Office365Users.UserPhotoMetadata(MyUserId).HasPhoto = false, LookUp(UserPhoto,UserId = MyUserId)),{Photo:PhotoToUpload})
Best Regards,
Allen
Hi @Venkat_Veda ,
Do you want to add a photo if the person does not have a photo.
I assume that:
1. Your Patch formula is correct,
2. “MyUserId” in your formula is the ID got from Office365, like below format(otherwise you need to get the userID from Office365 first):
If yes, based on your formula, you can add below condition to judge if this user already has a photo. This time Patch function will only work when the people doesn’t has a photo:
Patch(UserPhoto,If(Office365Users.UserPhotoMetadata(MyUserId).HasPhoto = false, LookUp(UserPhoto,UserId = MyUserId)),{Photo:PhotoToUpload})
Best Regards,
Allen
User | Count |
---|---|
158 | |
91 | |
68 | |
63 | |
63 |
User | Count |
---|---|
210 | |
157 | |
93 | |
81 | |
71 |