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.
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
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
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
User | Count |
---|---|
157 | |
93 | |
78 | |
73 | |
57 |
User | Count |
---|---|
201 | |
166 | |
98 | |
94 | |
79 |