web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Server Response: Objec...
Power Apps
Answered

Server Response: Object must implement IConvertible

(2) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @ztmcgoogan 

    Whenever you see "deep" errors like that from a DataSource, something has gone wrong.  I would do the following:

    1) Save and exit the designer

    2) Go back in to edit

    3) Refresh your datasource (the SharePoint list) in PowerApps

     

    And, now to the formula (which, for the most part is correct).  You do have one issue.  It should be:

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

    Now, I think you are just getting to this formula to troubleshoot and this is obviously not your intended formula.  So...we can cross that bridge more once you get past this.

    But, definitely try those steps above.

     

    I hope that is clear and helpful.

  • ztmcgoogan Profile Picture
    23 on at

    @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!

  • ztmcgoogan Profile Picture
    23 on at

    @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}));

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    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.

  • Community Power Platform Member Profile Picture
    on at

    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

     

  • Community Power Platform Member Profile Picture
    on at

    Sorry, He is the error code from Power Apps:

    Warehousetechie_1-1609417026715.png

     

  • hackondor Profile Picture
    37 on at

    Oh, you're a genius! 🙏

  • vish3027 Profile Picture
    434 on at

    Thanks This helps

  • VincentGiovanni Profile Picture
    on at

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard