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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Issues patching to a collection

(0) ShareShare
ReportReport
Posted on by 289

Hi Guys,

I have an app with the following code running when the app starts:

ClearCollect(colProducts, Defaults('Capex Requested Products'));

I have a gallery with a repeating table and I am attempting to patch a row to my collection using the following code:

Patch(colProducts, ThisItem, 
 {Title:dd_ProductFamily.Selected.Result,
 ProductLine:dd_ProductLine.Selected.Result, 
 ProductCategory:dd_ProductCat.Selected.Result, 
 ProductGroup:dd_ProductGroup.Selected.Result, 
 ProductType:dd_ItemNo.Selected.Result, 
 NewSupplier_x003f_:radio_NewSupplier.Selected.Value,
 NewSupplierName:txt_NewSupplierName.Text,
 Supplier:If(radio_NewSupplier.Selected.Value="Yes","",dd_SupplierName.Selected.Result),
 BOM:dd_BOM.Selected.Result,
 EnergyStrategy_x0028_LowEmission:radio_LowEmission.Selected.Value,
 UnitCost:Value(txt_UnitCost.Text),
 UnitQty:Value(txt_UnitQty.Text),
 LineCost:Value(txt_LineCost.Text) });

It is complaining about the LineCost column, the error is This type of argument 'LineCost' does not match the expected type Number. Found type Text

txt_LineCost is a text box which has a type of number. It is also of type number on my Sharepoint List

I have the same question (0)
  • C-Papa Profile Picture
    1,836 on at
    Re: Issues patching to a collection

    have you tried not converting it to a value?

     

    LineCost: txt_LineCost.Text

     

    Are you sure it is a number column in SharePoint? and are you sure that the text within txt_LineCost is a number only, e.g. there are no symbols "£" or text characters? if there are it will not be able to convert it to a number. 



  • JimJim Profile Picture
    289 on at
    Re: Issues patching to a collection

    Thank you, I did try not converting it to a number, but this didn't work.

    I am confident that there are no characters in the textbox that aren't numerical (It's a calculated field)

  • C-Papa Profile Picture
    1,836 on at
    Re: Issues patching to a collection

    can you send a print screen of the column settings from SharePoint and the txt_LineCost.Text calculation. has this column been edited in SharePoint at any time? e.g. column type changed? if so it would be worth removing the data source in PowerApps and adding it again

  • Verified answer
    JimJim Profile Picture
    289 on at
    Re: Issues patching to a collection

    Instead of using my existing collection, I tried it with a new collection and it is working. I really don't understand why this resolved my issue

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 655 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 391 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 225

Last 30 days Overall leaderboard