cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ChadVKealey
Level 8

Server Response: Object must implement IConvertible. on Patch formula

I have a fairly long and ugly Patch statement in an app I'm working on (which I'll include below). Yesterday, it was working fine...today, it's throwing an error and not actually doing what it's supposed to do (create an item in a list called Orders). The specific error message is: 

 

The requested operation is invalid. Server Response: Object must implement IConvertible. clientRequestId: 3dc1369b-292c-4286-b5f8-d07474b7b7af serviceRequestId: 77b6799e-20ae-6000-dfe9-291405f85bf9

 

In the PowerApps editor, the whole Patch statement has the red squiggle under it, which is super helpful in determining what part of it is at fault. Here's the entire erroneous function:

[NOTE: text fields are standard font, person fields are bold, choices are italicized, booleans are underlined]

 

Patch(Orders,Defaults(Orders),{Title: val_OrderDevChoice.Text,
OrderDate: Today(),
OrderCycle: var_CurrCust.OrderCycle,
AddOnItems: val_OrderAddOnItems.Text,
AddOnsCost: Value(val_OrderAddOnsCost.Text),
RecipUname: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpander",
Claims:"i:0#.f|membership|" & User().Email,
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle:".",
Picture:"."
},
LastName: var_CurrCust.Title,
FirstName: var_CurrCust.FirstName,
WorkPhone: val_BusPhone.Text,
WorkFax: val_FaxNumb.Text,
AltContactInfo: val_AltContactInfo.Text,
Building: val_Bldg.Text,
Floor: val_Floor.Text,
Office: val_Office.Text,
PlatformChange: val_PlatformChng.Selected,
UsingDrexelOneDrive: val_UsingOD4B.Value,
DataXfer: val_DataXfer.Value,
ConnNetPrint: val_ConnNetPrint.Value,
ConnPeriph: val_OrderConnPeriph.Value,
PeriphDesc: val_PeriphDesc.Text,
DrexDeptName: var_CurrCust.DrexDeptName,
DrexDeptCode: var_CurrCust.DrexDeptCode,
CollSchool: var_CurrCust.CollSchool
}));

 

I've done some searching, but can't find anything relevant to this error in PowerApps. Any help would be greatly appreciated.

 

-Chad

5 REPLIES 5
ChadVKealey
Level 8

Re: Server Response: Object must implement IConvertible. on Patch formula

Nevermind...I figured it out. The "AddOnsCost" field (in the list) was set to "Currency", and I was trying to pass in a text value ("none"). I changed the form logic to pass in "$0.00" instead of "none" and it seems to be working now.

RandyR1963
Level: Powered On

Re: Server Response: Object must implement IConvertible. on Patch formula

I have this issue and am not able to locate the problem, and not finding a solution in the forum,

Why do i get this The Requested operation is invalid. Server Response: Object must implement IConvertible

I am doing a Collect on these fields and the Patch. 

Below is the Code for Patch that i am using, nothing seems wrong here. No errors

 

Patch(ResSol_Events_1,Defaults(ResSol_Events_1),

{ Event_Date: EventDate.Text,

OGE_Customer_Name: CustName,

Service_Address: ServAddress,

City:CustCity,

Zip: CustZip,

Phone: CustPhone,

Mobile_Phone: MobilePhone,

Email_Address: EmailAddress,

OGE_Customer: CustYesNo,

Home_Assessment: HomeAssessment,

AC_Tune_Up: ACTune,

Best_Day_To_Call: BestToCall}

))

jpacettf
Level 8

Re: Server Response: Object must implement IConvertible. on Patch formula

hey @ChadVKealey  sorry for responding to an old post but I was wondering if you could show me how you patched the currency field (I have done exactly the same!)

ChadVKealey
Level 8

Re: Server Response: Object must implement IConvertible. on Patch formula

@RandyR1963 , this "must implement IConvertible" bit basically means you're trying to pass in a value that isn't compatible with the field/column type. For example, I was trying to pass a text value into a currency field. So, pay close attention to the type of column or field you have and the type of data you're patching into it.

 

@jpacettf , I didn't actually need to pass a currency value, however, if you do, you just want to make sure that you have the text input set to "number" format. Also, when patching (even though it's already a 'number' input), you need to use the Value operator. So, if your text input control is "TextInput1" and the field/column is "Cost", you'd use (inside your Patch statement):

Cost: Value(TextInput1.text)

 

That should do the trick.

jpacettf
Level 8

Re: Server Response: Object must implement IConvertible. on Patch formula

@ChadVKealey @RandyR1963 Thanks so much, that has worked a treat Smiley Happy!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 184 members 4,484 guests
Please welcome our newest community members: