Categories: Microsoft Power Apps

Object must implement IConvertible in Power Apps

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.

Patch the wrong way

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

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.

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?

Share
Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

View Comments

  • 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.

Recent Posts

8 top reasons to use Dataverse or SharePoint lists in the Power Platform

Why would you use Dataverse, if SharePoint lists gives you the option to avoid premium…

6 days ago

Filter by calculated fields in SharePoint using Power Automate

When you read items from a SharePoint list and you want to filter by calculated…

1 week ago

Expected String but got Null, when calling a flow from a Model Driven app

A few weeks ago I looked at calling flows from model driven apps. And for…

1 week ago

Get all your broken connections using Power Automate

To get all your broken connections in the Power Platform can be a challenge. In…

2 weeks ago

Customer Voice a.k.a. Forms Pro the database behind the magic

If you call Customer Voice still Forms Pro or not, have you ever looked into…

2 weeks ago

Many running flows in Power Automate

Recently I noticed that some of my flows end up with many running flows. Types…

3 weeks ago
%%footer%%