Experts,
I'm working on a canvas app to save online data to offline collections.
Following temporary table structure,
ClearCollect(TableTempx,{priority: "xx",
state: "xx",
sequence: 0,
breakdownSymptomGroupCode:"xx" ,
breakdownSymptomCode:"xx" ,
shortText: "xx",
orderNumber: "xx",
orderClass: "xx",
customerCode: "xx",
center: "xx",
equipmentCode: "xx",
activityClass: "xx",
adviceText: "xx",
orderDate: "xx",
serviceType: "xx",
routeId: "xx",
syncType: "xx"
});
Now i am trying to copy the data from collections(opernorder) to temporary table Tabletempx with following code,
ForAll(openorder,Patch(TableTempx,
Defaults(TableTempx),
{
orderNumber: orderNumber,
customerCode: customerCode,
equipmentCode: equipmentCode,
activityClass: activityClass,
adviceText: adviceText,
orderDate: orderDate,
serviceType: serviceType,
routeId: routeId,
syncType: syncType,
orderClass: orderClass
}
)
)
Data is getting copied. But during offline this temporary data is disappearing. Please guide me to debug the same.
Hi @AVTS ,
Firstly you have an ambiguity issue - also I assume TableTempx is a collection - or is it the Table on the device? If a colleciton
ForAll(
openorder As aList,
Collect(
TableTempx,
{
orderNumber: aList.orderNumber,
customerCode: aList.customerCode,
equipmentCode: aList.equipmentCode,
activityClass: aList.activityClass,
adviceText: aList.adviceText,
orderDate: aList.orderDate,
serviceType: aList.serviceType,
routeId: aList.routeId,
syncType: aList.syncType,
orderClass: aList.orderClass
}
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Your basically copying one Collection to another. Both are stored in memory. So what you are doing will not maintain data when you exit the app. If you want to store data while you are offline then you need to use SaveData() and LoadData() to store the collection. Be aware that these will only work on Mobile devices with a player, like IOS and android. SaveData, LoadData, and ClearData functions in Power Apps - Power Apps | Microsoft Docs
He says he is copying an online collection to save it offline. There is no such thing. Collections by definition are local, so they only need to be saved if you are shutting down the app. I suspect he is going offline and when he re-opens the app the local collection is no longer there so he is trying to save it in a data structure. The only way to do that would be SaveData.
Team,
I am having challenge here. I'm developing an application in a location where there is no network access, hence I should use the power app offline mode. As an example, at the beginning of each day, a call flow is invoked to obtain online data and save it in an offline cache (virtual table). And then, regardless of connection state, begin working on the offline cache (virtual table). And offline cache (virtual table) would like to display it on a data table . And later on will transmit this offline cache (virtual table) to another online table .
Is this possible?
@AVTS ,
As @Pstork1 mentioned, you need to use SaveData/LoadData if you want to retain your temporary table in the case of the app closing before it is saved online. Also for any app with data connections (online) I have found it needs to be opened online to initiate the connection, so the offline capability is a bit limited to areas with poor signal where you can open it.
Agreed, Warren . Here during connection active time we are receiving the data from flow ,Code follows,
Collect(test1,Getopenorderok.Run("ee01"));
And saving the collections (test1) to offline data (TableTempx) , Code follows
SaveData(test1,"TableTempx1");
For loading i am using following code ,
LoadData(test1,"TableTempx1",true);
Now i am unable to verify the the data is properly copied from test1 to TableTempx1. How to show and verify the data from offline cache.
Following screenshot from web browser and all test is carried in Mobile.
HI @AVTS ,
What have you got to verify it against? It involves a bit of trust in the process I think.
User | Count |
---|---|
253 | |
106 | |
88 | |
51 | |
43 |