Hi, In my Power App I am taking my events from Outlook Calendar and saving data in a SharePoint list. In SharePoint list with other columns also I have a Person column (Allow : multiple) named "Participants" and another Single line text column named "OtherParticipants" where I need to save "requiredAttendees" field's value of Outlook event.
Let's say the value of requiredAttendees="mamun@mydomain.com;abc@mydomain.com;xyz@otherdomain.com;zyx@otherdomain.com;"
So now I have to save the value of "@mydomain.com" users to "Participants" column and "@otherdomain.com" users to "OtherParticipants" column. I have tried few ways to save data in the "Participants" column but for outside domain users I am getting error "An Unknown error occurred" message. below is my code (though I did not try to save data in the "OtherParticipants" column yet
Participants: If(requiredAttendees<>"",
ForAll(
Split(
Left(requiredAttendees,Len(requiredAttendees)-1),
";"
),If(Text(Trim(Result)) in Office365Users.SearchUserV2().value.Mail,
{
DisplayName: Office365Users.UserProfileV2(Text(Trim(Result))).displayName,
Claims: "i:0#.f|membership|" & Lower(Office365Users.UserProfileV2(Text(Trim(Result))).userPrincipalName),
Department: "",
Email: Office365Users.UserProfileV2(Text(Trim(Result))).userPrincipalName,
JobTitle: "",
Picture: ""
})
)
)
In the place of 2nd If condition (If(Text(Trim(Result)) in Office365Users.SearchUserV2().value.Mail), I have tried below ways also but always getting same error
1. IsMatch(Substitute(Right(Text(Trim(Result)),Len(Text(Trim(Result))) - Find("@",Text(Trim(Result)))),";",""),UserDomain,Contains & IgnoreCase)
2. Lower(Substitute(Right(Text(Trim(Result)),Len(Text(Trim(Result))) - Find("@",Text(Trim(Result)))),";",""))=Lower(UserDomain)
3. (Find(Lower(UserDomain),Lower(Text(Trim(Result)))))>0
4. !(IsEmpty(Office365Users.UserProfileV2(Text(Trim(Result)))))
5. If(Text(Trim(Result)) in Office365Users.SearchUserV2().value.Mail
Can you please help me actually what am I missing? Also if possible add code for "OtherParticipant" column
Very urgent help needed!!!
Thanks!