web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Replicate live collect...
Power Apps
Unanswered

Replicate live collection data in to offline collections

(0) ShareShare
ReportReport
Posted on by 538

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. 

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    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

     

  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    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

  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    Thanks @Pstork1 ,

    I may have misread the question - @AVTS can you please confirm by "offline" you mean the app closed, not that the data disappears while you are using it offline.

  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    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.

  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    @Pstork1 ,

    Agree totally 

  • AVTS Profile Picture
    538 on at

    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? 

     

     

  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    @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.

  • AVTS Profile Picture
    538 on at

    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.

    AVTS_0-1637039206224.png

     

  • WarrenBelz Profile Picture
    155,752 Most Valuable Professional on at

    HI @AVTS ,

    What have you got to verify it against? It involves a bit of trust in the process I think.

  • AVTS Profile Picture
    538 on at

    Hi Warren,

     

    My requirement is like this. 

     

    I have a flow which retrieve data from external database. Flow is assigned to the button click collection.

     

    Collect(test1,Getopenorderok.Run("ES001"));

     

    I am able to view the collection , Screenshot follows,

    AVTS_0-1637061290290.png

     

    Now i need to save this data in to offline for further use.  Using following code,

     

    SaveData(test1,"TableTempx1");

    LoadData(test1,"TableTempx1",true);

     

    As i said in previous message i am unable to show or view this offline (TableTempx1) data anywhere. 

     

    How can i achieve this. 

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard