Object must implement IConvertible

In Power Apps when you do a Patch to create a new item or to update an existing item you migth have found the error Object must implement IConvertible

Object must implement IConvertible

You have figured out how to use the Patch function but when you run the code you get the following error:

The requested operation is invalid. Server response: … failed: Object must implement IConvertible

Most low coders will think of a nice car without a roof now!

It’s time for another real SharePain as this high code error message in a low code platform will confuse many people.

The requested operation is invalid. Server response: ... failed: Object must implement IConvertible

Patch the wrong way

We need to have a more detailed look at the code here.

Object must implement IConvertible in Power Apps Microsoft Power Apps patch command wrong

In my code the TextInput1_1 control is holding the data that I want to use to update my list item in SharePoint. it is so easy to just type the control name and assume that all is ok.

Patch(
    'Training Records',
    Defaults('Training Records'),
    {
        Title: TextInput1_1,
        ...
    }
)

But this is wrong, TextInput1_1 is a control and not a piece of string (aka text). To get to the data in the control TextInput1_1.Text will need to be used.

Object must implement IConvertible in Power Apps Microsoft Power Apps patch command right

It is such an easy mistake to make, and such unclear error message to get.

Trying to understand the error message

Sorry we will have to go into coding language here. I’ve had a look around for an easy to understand explanation about IConvertible. From the referenced site I got:

Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value.

Any clearer now?

I prefer the following:

Turn something complicated into something simple.

So taking “Object must implement IConvertible” back into Power Platform language:

The TextInput control returns information that cannot be used as a text, number or date value.

Wouldn’t it be nice if complicated and difficult to understand error messages were translated into something more human like?

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

13 thoughts on “Object must implement IConvertible in Power Apps”
  1. That is the best, and only, explanation of that error I have ever seen, and I have spend something like 7 hours on support calls with Microsoft support trying to remove that error. In my situation, the error was related to that specific problem though. I want to add, for the community, the solutions that MS Support attempted:

    Refresh the data source

    Okay, that about covers it. That worked in 1 of the three scenarios that inspired me to open a ticket. The other two were resolved by re-creating the code, as I recall.

    My take-away is that this error is triggered by more situations than the developers originally envisioned.

  2. Whew… Thanks for this comment. I simply changed it to .text and now I am happy and the previous hours of frustration are gone.

  3. Thank you so much for this! The best explanation for this issue I have ever seen. I hate powerapps a little bit less, today.

  4. Thanks for saving me hours of trial and error.
    First time I’ve experienced this problem and the only time lost was the 5 minute Google search.
    Appreciate you, Pieter!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading