Skip to main content

Notifications

Community site session details

Community site session details

Session Id : m8g7815llpRrMKGhFfL3BT
Power Apps - Building Power Apps
Answered

Server Response: Object must implement IConvertible

Like (2) ShareShare
ReportReport
Posted on 3 Jun 2019 21:48:52 by 23

I've ran out of Google searches to try and fix my issue so hopefully someone here can lend a hand.

 

I have  gallery items that are imported from a Sharepoint list, users are able to select the ones they want (like a shopping cart) and then on a "submit" button , I need the selections to update a different SharePoint List but I keep running into the Iconvertible error.

 

I have stripped down by function to the following to remove all the variables I can think of but still no luck.

 

ForAll(OrderList, Patch(HSOrders,Defaults(HSOrders),{Title:Label9}))

 

Where the OrderList is my only collection, HSOrders is the Sharepoint List I am trying to update, currently the only column in the list that I am trying to update is the Title column, and Label9 is just a text field that is pulled from the gallery. 

Categories:
  • VincentGiovanni Profile Picture
    on 14 Jun 2022 at 04:18:42
    Re: Server Response: Object must implement IConvertible

    Hello, 

     

     

    I'm currently struggling with this issue, Can't seem to figure it out.
    So I've a SP list with several columns (all are text based columns) Supplier, Ordernumber, Internal Number, Article Number, Product, Quantity, Date, Recipient, Comments.

    I changed my Onselect code to .Text after the Txtinput controls, and as the owner of the thread it only implemented the last item instead of all items even though there are several items in the collection. Thereafter I added the Defaults(SPList) formula so the full code is 
    ForAll(
    NyInleverans;
    Patch(
    'Innleveranse Lager';
    Defaults('Innleveranse Lager');
    {
    Leverantör: NyInleveransLeverantörTxtInput.Text;
    Ordernummer: [@NyInleveransOrdernummerTxtInput].Text;
    Ordermärkning: NyInleveransOrdermärkningTxtInput.Text;
    Artikelnummer: NyInleveransArtikelnummerTxtInput.Text;
    Produktbeskrivning: NyInleveransProduktTxtInput.Text;
    Antal: NyInleveransAntalTxtInput.Text;
    LeveransDatum: NyInleveransDatumTxtInput.Text;
    Mottagaren: NyInleveransBeställareTxtInput.Text;
    Kommentar: NyInleveransKommentarTxtInput.Text
    }
    )
    )

     

    But i still get the same result.

    My add button's OnSelect Property is as following ; 

     Collect(
    NyInleverans;
    {
    Title: NyInleveransLeverantörTxtInput.Text;
    Ordernummer: NyInleveransOrdernummerTxtInput.Text;
    Ordermärkning: NyInleveransOrdermärkningTxtInput.Text;
    Artikelnummer: NyInleveransArtikelnummerTxtInput.Text;
    Produktbeskrivning: NyInleveransProduktTxtInput.Text;
    Antal: NyInleveransAntalTxtInput.Text;
    LeveransDatum: NyInleveransDatumTxtInput.Text;
    Mottagaren: NyInleveransBeställareTxtInput.Text;
    Kommentar: NyInleveransKommentarTxtInput.Text
    }
    )

     

    What Am i doing wrong?

  • VincentGiovanni Profile Picture
    on 07 Jun 2022 at 11:49:14
    Re: Server Response: Object must implement IConvertible

    Hello!

    I had the same problem as this but i had multiple columns  and I recieved the same error code in which I changed them all to (TextInput.Text) at the end as the solution suggested, then it all worked except some of the data didn't change the value but was the same as the first Item in the collection but after many attempts i realised that just a couple of the columns needed the .Text altough they all were the same type of column (Text) After that everything worked and changed accordingly!

     

    So if someone had the same issue try using .Text on different combinations of the columns xD

    Best Regards

  • vish3027 Profile Picture
    434 on 18 Aug 2021 at 16:56:50
    Re: Server Response: Object must implement IConvertible

    Thanks This helps

  • hackondor Profile Picture
    37 on 21 Jul 2021 at 14:38:45
    Re: Server Response: Object must implement IConvertible

    Oh, you're a genius! đź™Ź

  • Community Power Platform Member Profile Picture
    on 31 Dec 2020 at 12:17:18
    Re: Server Response: Object must implement IConvertible

    Sorry, He is the error code from Power Apps:

    Warehousetechie_1-1609417026715.png

     

  • Community Power Platform Member Profile Picture
    on 31 Dec 2020 at 12:13:44
    Re: Server Response: Object must implement IConvertible

    I have a issue along the same lines.  I have refreshed the db and the other steps you outlined.  But still getting the runtime issue.  I am also trying to write to SP Lists. Code added.

    Warehousetechie_0-1609416782919.png

     

  • WarrenBelz Profile Picture
    146,958 Most Valuable Professional on 27 Nov 2020 at 04:14:49
    Re: Server Response: Object must implement IConvertible

    Just confirming to @RandyHayes 's solution - it just happened to me on a fairly large Patch.

    It refused to work (with this error on multiple attempts and refreshes) in Studio design after running code.

    Saved and exited and worked perfectly on re-entering.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 04 Jun 2019 at 14:55:23
    Re: Server Response: Object must implement IConvertible

    @ztmcgoogan 

    I had a feeling we would get to this part of it.  I assumed you were testing out patching with your original problem, but, yes, what you have is going to do exactly what you see.

     

    Now, I am not sure what you have in your OrderList as far as columns are concerned, but I'm going to take a guess that you have a Title, ItemNumber, SoldAs, Vendor, OrderAmount, DepartmentNumber, and OrderDate column.  Again, just a guess and am assuming you are collecting records in that OrderList for each item in your "cart".

    With the above assumption, then your formula should be like this:

     

    ForAll(OrderList, 
    Patch(HSOrders,
    Defaults(HSOrders),
    {Title: Title,
    ItemNumber: ItemNumber,
    SoldAs: SoldAs,
    Vendor: Vendor,
    OrderAmount: OrderAmount,
    DepartmentNumber: DepartmentNumber,
    Orderee: Office365Users.MyProfile().DisplayName,
    Date: OrderDate
    }
    )
    );

    As it was, your formula was referencing the individual text controls on your screen...which would be the same value for every record.  You need your formula to reference the columns in your OrderList as it is above.

     

    Try to work that into your formula and see if you get the results you are looking for.  

    If your OrderList does not have the information needed to complete the formula above, then perhaps we should look at how you are collecting records into that orderlist collection.

     

  • ztmcgoogan Profile Picture
    23 on 04 Jun 2019 at 14:13:11
    Re: Server Response: Object must implement IConvertible

    @RandyHayes 

     

    Sorry, I actually have one more issue regarding this if your able to help. While the patch function is working and the Sharepoint List is updating, it's only adding what the first item is and then duplicating it by how many items are in the collection, so if I have five different items and the first one is a pen, I'll have five pen entries on the list instead of each individual item. Here is the full formula I am using.

     

    ForAll(OrderList, Patch(HSOrders,Defaults(HSOrders),{Title:Title2.Text,ItemNumber:Label9_1.Text, SoldAs:Subtitle2.Text, Vendor:Label9_2.Text, OrderAmount:Label9.Text,DepartmentNumber: Label9_3.Text,Orderee: Office365Users.MyProfile().DisplayName, Date:Label3.Text}));

     

  • ztmcgoogan Profile Picture
    23 on 04 Jun 2019 at 13:37:59
    Re: Server Response: Object must implement IConvertible

    @RandyHayes 

    Thanks so much! It was the .text after my label that was causing the issue. That was a barebones formula just to try to get it to work as this was my first attempt at a patch but I've entered the rest of it in and tested and everything works as inteded. Again thank you for the help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 98 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard