cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bri
Advocate III
Advocate III

Disable the red error message

I have an app that grabs employee photos, and if the employee does not have a photo the app returns that red error message at the top, a 404 error has occured. Can i disable this error message? I can handle the error fine in the app with the IsBlank funtion, but the message still shows for my end users... How can i disable the message?!

18 REPLIES 18
Anonymous
Not applicable

Thank you so much ! If this helps anybody, this solved my problem on a different issue with 502 error message : "the server did not receive a response from an upstream server powerapps"

 

 

Anonymous
Not applicable

I use this, an it work fine, in a gallery

 

If(!IsBlank(ThisItem.Id),IfError(Office365Users.UserPhoto(ThisItem.Id),""),SampleImage)

Anonymous
Not applicable

I use this code inside the gallery an it works, 

 

If(!IsBlank(ThisItem.Id),Office365Users.UserPhotoV2(ThisItem.Id),SampleImage)

When I try this solution, the image does now show up. 

New, more simple solution.

 

This red error message just started showing up for me after working fine for a few months. The fastest solution I came up with was to replace the ThisItem reference with a global variable instead.

 

When a user clicks on the record in my gallery, I added Set(var_UserImage,ThisItem.'Created By'.Email).  

When you use Office365Users.UserPhoto with a global variable instead of a record lookup it works just fine. I was able to remove the IsBlank check as well. It just works now.

 

Office365Users.UserPhoto(var_UserImage)

That's interesting.  Struggling to suppress this error I had the exact same idea to replace that parameter with a global variable (initialized with a valid ID).  I can say for certain that the global variable idea does not work within the context of the OnChange action of a combobox.  I have even gone as far as doing both: attempting to trap the error with IfError and using a global variable:

 

ComboBox OnChange property

 

If(
    IsEmpty(comboCEOselection),
    false,
    Set(
        varIDTemp,
        comboCEOselection.Selected.Id
    );
    IfError(
        UpdateContext({conSelectedCEO: Office365Users.UserProfileV2(varIDTemp)}),
        ""
    )
)

 

 

 Still, every time this app is run the error is seen.  It is so frustrating.

 

JeffTex_0-1654788786063.png

 

The detail of the error in Monitor show:

 

Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'

 

{
  "status": null,
  "duration": null,
  "dataSource": null,
  "responseSize": null,
  "controlName": null,
  "propertyName": null,
  "nodeId": null,
  "formulaData": {
    "script": "",
    "spanStart": null,
    "spanEnd": null
  },
  "data": {
    "errorContext": {
      "entityName": "comboCEOselection",
      "propertyName": "OnChange",
      "nodeId": 14,
      "id": 3441,
      "diagnosticContext": {
        "formula": "If(\n    IsEmpty(comboCEOselection),\n    false,\n    Set(\n        varIDTemp,\n        comboCEOselection.Selected.Id\n    );\n    IfError(\n        UpdateContext({conSelectedCEO: Office365Users.UserProfileV2(varIDTemp)}),\n        \"\"\n    )\n)",
        "span": {
          "start": 172,
          "end": 211
        }
      }
    },
    "errorMessage": "Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'",
    "raiseToastNotification": false,
    "wasReported": false,
    "error": {}
  }
}

 

 

And:

 

Unhandled error

 

{
  "status": null,
  "duration": null,
  "dataSource": null,
  "responseSize": null,
  "controlName": null,
  "propertyName": null,
  "nodeId": null,
  "formulaData": {
    "script": "",
    "spanStart": null,
    "spanEnd": null
  },
  "data": {
    "errors": [
      {
        "Kind": 23,
        "Message": "Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'",
        "Source": "comboCEOselection.OnChange",
        "Observed": "lblCEOselectionInfo.Text",
        "Details": null
      },
      {
        "Kind": 23,
        "Message": "Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'",
        "Source": "comboCEOselection.OnChange",
        "Observed": "lblCEOselectionInfo.Text",
        "Details": null
      },
      {
        "Kind": 23,
        "Message": "Office365Users.UserProfileV2 failed: The method 'UserProfileV2' has an invalid value for parameter 'id'",
        "Source": "comboCEOselection.OnChange",
        "Observed": "lblCEOselectionInfo.Text",
        "Details": null
      }
    ]
  }
}

 

 

 

 

And to my disappointment it worked fine the day I tested and published the app, now a week later the error message is back. I opted to remove the user photo from this app for the time being. I would rather improve their user experience than to troubleshoot this nonstop.

 

I have a few ideas on more things to test. If I get a solution I'll reply here. 

Exactly the path I am finding myself having to take: reduce the functionality and use of the Office365 connector to preserve the User Experience.  It is a shame.   I would rather a global setting that would allow the suppression of ALL Office365 connector error messages.

JeffTex
Helper I
Helper I

After posting my previous reply with the Monitor info, it came to my attention that the unhandled error was an additional control dependent on the values that would have been captured in the OnChange action of the ComboBox.

 

Encapsulating the Text property of that label shown in Monitor as:

"Observed": "lblCEOselectionInfo.Text",

resolved the error.  I needed the IfError added to both the ComboBox action as well as the downstream controls dependent on the value.  The label's Text Property is now set as:

IfError(
    conSelectedCEO.jobTitle & Char(13)&
    conSelectedCEO.department & Char(13) &
    conSelectedCEO.companyName,
    ""
)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,114)