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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,502)