web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / UserprofileV2 error
Power Apps
Unanswered

UserprofileV2 error

(0) ShareShare
ReportReport
Posted on by

Team,

 

I would like to get the employee's designation based on the name(Datacardvalue10). The formula looks fine. However, during the submission, I am getting the "Office365users.UserProfileV2 failed. The method UserProfileV2 has an invalid value of parameter 'id'. 

Please help me to fix the issue.

 

If(!IsBlank(Find("-",Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle)),
Left(Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle,Find("-",Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle)-1),

!IsBlank(Find(",",Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle)),
Left(Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle,Find(",",Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle)-1),
Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle
)

 

Regards,

Alwin

Categories:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hey @allwynbazil,

     

    You should probably be using With so that you aren't repeatedly calling the Office365Users, like this:

     

    With({ O365Lookup: Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle},
     If(!IsBlank(Find("-",O365Lookup)),
     Left(O365Lookup, Find("-", O365Lookup) -1),
     !IsBlank(Find(",",O365Lookup)),
     Left(O365Lookup, Find(",", O365Lookup) -1),
     O365Lookup
     )
    )

     

    but from the error message it sounds like the account you chose either doesn't have a proper email address (is it a service account or some other kind of non-user account?) or its doing the lookup before there is a selected item. So you can probably mitigate that with a check at the beginning like this:

     

    If(!IsBlankOrError(DataCardValue10.Selected.Email),
     With({ O365Lookup: Office365Users.UserProfileV2(DataCardValue10.Selected.Email).jobTitle},
     If(!IsBlank(Find("-",O365Lookup)),
     Left(O365Lookup, Find("-", O365Lookup) -1),
     !IsBlank(Find(",",O365Lookup)),
     Left(O365Lookup, Find(",", O365Lookup) -1),
     O365Lookup
     )
     )
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard