cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Value must be a data entity record

Hi All,

 

I am creating an offline app and whenever I am trying to patch data into CDS when I have an internet connection, it is throwing me error saying "value must be a data entity record".

And data is not getting inserted.

 

What might be the possible reason for that? Is it because of Lookup column?

 

Any help will be appreciated. 

5 REPLIES 5
v-albai-msft
Community Support
Community Support

Hi @Anonymous ,

I think the issue you are facing is related to the lookup column. You can simply understand that the lookup field stores the related records in the parent entity, so try to use LookUp function to retrieve the related record based on the value you selected or your entered.

I assume that:

1. You have two table called “Table1” and “Table2”.

2. Table1 has a lookup column called “lookup1” from “Table2”.

So this is the formula:

Patch(Table1S,Defaults(Table1S),
{
Name:DataCardValue1.Text,
lookup1: LookUp(Table2S,Name=DataCardValue5.Selected.Name)
}
)

Above is just an example, you should replace with your own control name in the formula.

If I misunderstand, please let me know and provide some screenshots for helping me understand better.

Best Regards,

Allen

Anonymous
Not applicable

Hi @v-albai-msft ,

Thanks for the reply. I have used the same formula and it should work.
I think my issue might be this-

https://powerusers.microsoft.com/t5/Building-Power-Apps/Offline-issue/m-p/856844#M272292

 

Hi @Anonymous ,

I am not sure, since the article you provided just have one answer, which suggest to follow Shane Young's video.

For your issue, I would suggest you re-check your formula(you can also provide your code here so that I can find the difference with mine). Also, for a test purpose, don't edit the lookup column to see if you can successfully patch it.

Best regards,

Allen

 

Anonymous
Not applicable

Hi @v-albai-msft ,

This issue occurs only for below situation-

If I open the PowerApps Mobile, but not open the canvas app, then disconnect the internet, the issue will happen.

It works for below situation-

If I open the PowerApps Mobile, and open the canvas app, then disconnect the internet. And then connect the internet while sending the data.

Hi @Anonymous ,

Glad you have found the cause and solution.  You can mark your answer as a solution. This will benefit other community members who stuck with the same question.

Besides, if you want to dig into this issue then it would probably be best to open a ticket with Microsoft Support on this one.

Get Help + Support - Power Platform | Microsoft Docs

Best regards,

Allen

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,953)