Search code examples
sharepointoffice365power-automatepowerappspowerapps-canvas

When my power apps app open its showing some office365 error message


I am getting error Office365Users.ManagerV2 failed: {"error": { "code": "ResourceNotFound", "message": "User not found", "InnerError": { "date": "2023-11-08T13:15:01", "requesr-id": " ", "client-request-id": " "} } }

But in edit mode its not giving any warning or error

I am trying to get current login user's manger and manager's of manager. Bellow I am using PowerApps formula is Office365Users.ManagerV2(TextInput2.Text).mail on default property of textbox field

First field is Office365Users.ManagerV2(User().Email).mail

I don't know where I am wrong in this


Solution

  • Sometimes you will get errors and usually it is about timing, luckily these resolve themselves. So use IfError.

    First one:

    IfError( Office365Users.ManagerV2(User().Email).mail, "" )
    

    Second one:

    If( !IsBlank(TextInput2.Text),
      IfError( Office365Users.ManagerV2(TextInput2.Text).mail, "" )
    )