cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marekmarek1
Frequent Visitor

Patch Error - Value Must Be A Data Entity Error

Hello,

 

I have a dataverse table (SSE | BDR Risk Managements) which contains four columns from other tables in the dataverse. The app has to allow users to write data in this table (add records). There are input forms allowing to do that. All of the inputs (except "Name") come from lookup tables. Note that there are dropdowns (based on the lookup columns). Only comment is a free text box.

 

When I run this function, I have the error "Value Must Be A Data Entity Error". How can I fix it?

 

thanks,

Marek

 

Patch(
'SSE | BDR Risk Managements',
Defaults ('SSE | BDR Risk Managements'),
{crde1_name: "Patch Test"},
{crde1_comment: Text(DataCardValue2.Value)},
{crde1_Entity: DataCardValue4},
{crde1_Customer: DataCardValue5},
{crde1_priority: DataCardValue3.Selected.Value},
{crde1_ReportDate: DataCardValue6}
)

2 REPLIES 2
daruom
Helper II
Helper II

Hello,

 

if you are using a form, why use "patch".
The "SubmitForm" function is more practical

 

For your question, when you create 1 single record, all your fields must be between "{}".

Patch(
'SSE | BDR Risk Managements',
Defaults ('SSE | BDR Risk Managements'),
{
crde1_name: "Patch Test",
crde1_comment: Text(DataCardValue2.Value),
crde1_Entity: DataCardValue4,
crde1_Customer: DataCardValue5,
crde1_priority: DataCardValue3.Selected.Value,
crde1_ReportDate: DataCardValue6
}
)

 

 With several "{}", as in your example, it is to create several record, example:

Patch(
'SSE | BDR Risk Managements',
Defaults ('SSE | BDR Risk Managements'),
{
crde1_name: "Test1",
crde1_comment: Text(DataCardValue2.Value),
crde1_Entity: DataCardValue4,
crde1_Customer: DataCardValue5,
crde1_priority: DataCardValue3.Selected.Value,
crde1_ReportDate: DataCardValue6
},
{
crde1_name: "Test2",
crde1_comment: Text(DataCardValue2.Value),
crde1_Entity: DataCardValue4,
crde1_Customer: DataCardValue5,
crde1_priority: DataCardValue3.Selected.Value,
crde1_ReportDate: DataCardValue6
}
)

@daruom thanks for the reply!

1) What is the submit function, what do you mean? I am quite new to Power Apps...

 

2) I copied the first patch you put, but it doesn't work either - the same error message...

 

Edit

Ok got it with the submit function. The problem here is that I may need to add a user drop down from Office365 and I think for this I need a separate item (input box?)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (987)