Power Apps: Exception in Canvas Apps – Object not set to an instance of an object.

Hey there,

Recently, I have encountered the following exception in my Power Apps – Canvas App.

The requested operation is invalid.
Server response: [Datasource name] failed: An error has occurred. Object not set to an instance of an object.
ClientRequestedId: [#GUID]

Canvas App

If you are also facing this exception in your Canvas Apps, then the following proposed solution is for you.

Exception:

Actually, you are facing this exception because you are passing a “null” value to your Canvas App “function” (Filter/LookUp/Search etc.). All you need to do is to check your value before calling a function.

Solution:

To avoid this exception, just make sure you are writing your expressions in a correct way.

Correct:
If(
(!IsBlank(<‘Control Name’>)),

Filter(<‘Datasource name’>, <‘Column name’> = <‘Control Name’>.Text)
)

Incorrect:
Filter(<‘Datasource name’>, <‘Column name’> = <‘Control Name’>.Text)

  1. You should use this approach with all such expressions in your Canvas App.
  2. “<‘Control name’>” inside “IsBlank” method can be replaced with your variable name, if you are using variable for filtration.
  3. Similarly, “Filter” function can be replaced with LookUp, Search, or similar functions, it depends from where you are getting that above error.

I hope it’ll help you.

Thank you!