Hi all,
I made the same app as the link below and everything worked fine untill I wanted to patch my data. The patch functions gives an error called "Invalid argument type (Table), Expecting a Record value instead. How can I solve this?
Power Apps Editable Table/Gallery like Excel (Tutorial) - YouTube
App OnStart I have:
ClearCollect(colTaskUpdates,
Defaults('Customer VAT')
;
Clear(colTaskUpdates)
)
In a gallery variable I have OnSelect:
If(
ThisItem.'Customer VAT ID' in colTaskUpdates.cr99c_customervatid,
Update(
colTaskUpdates,
LookUp(
colTaskUpdates,
cr99c_customervatid = ThisItem.'Customer VAT ID'
),
{
cr99c_customervatid: ThisItem.'Customer VAT ID',
cr99c_invoicenumber: InvoiceNumber_1.Text,
cr99c_nettinvoiceamount: NettInvoiceAmount_1.Text,
cr99c_vatamount: VATAmount_1.Text,
cr99c_invoicedate: InvoiceDate_1.Text,
cr99c_buyer: Buyer_1.Text,
cr99c_countrycodebuyer: CountryCodeBuyer_1.Text,
cr99c_vatidnumberbuyer: VATIDNumberBuyer_1.Text
}
),
Collect(
colTaskUpdates,
{
cr99c_customervatid: ThisItem.'Customer VAT ID',
cr99c_invoicenumber: InvoiceNumber_1.Text,
cr99c_nettinvoiceamount: NettInvoiceAmount_1.Text,
cr99c_vatamount: VATAmount_1.Text,
cr99c_invoicedate: InvoiceDate_1.Text,
cr99c_buyer: Buyer_1.Text,
cr99c_countrycodebuyer: CountryCodeBuyer_1.Text,
cr99c_vatidnumberbuyer: VATIDNumberBuyer_1.Text
}
)
)
The save button OnSelect has
If(
CountRows(colTaskUpdates) > 0,
Patch(
'Customer VAT ID',
colTaskUpdates
);
Notify(
"Succees",
NotificationType.Succees
)
);
Clear(colTaskUpdates)
In dataverse the data types of the following variables are:
cr99c_customervatid: Unique Identifier
cr99c_invoicenumber: Text
cr99c_nettinvoiceamount: Currency
cr99c_vatamount: Currency
cr99c_invoicedate: Date Only
cr99c_buyer: Text
cr99c_countrycodebuyer: Text
cr99c_vatidnumberbuyer: Text
@Reza