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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,213)