My App is used on different devices and many users. Some of the devices (big Touch Screens) are always open for users to pass by and update records.
To keep alle devices (users) updated with the latest data, I'am using timers to refresh and clearcollect data from CDS (users "patch" updates using flows in many cases.
I have a really hard time to get clearcollect working. I have tried the tricks using 2 timers - one updating after the first one, making sure that all connections are refreshed and so forth.
But! - it's not really realiable! - screens are flashing and confusing users, and many times data are not updated until the third or forth time the timer has been triggered.
What is the best way to keep collections updated on the different devices? - I really need some input.
One of my timers looks like this:
If(
Showquickmenu = false;
UpdateContext({Starttimer2Update: false});;
Concurrent(
ClearCollect(Aureteborger; [@Borger]);
ClearCollect(
Nyborgercollection;
AddColumns(
Filter( Borgerregistrering;
crea5_companycode = AU_CID
And Opholdstype = Opholdkategori
And Afsluttet = 0
);
"onavn";'Oprettet af'.'Fulde navn';
"TranspBillede";
LookUp(
AureteTransport;
cr9eb_tranid = Value(Transportype);
Transportbillede
)
)
)
Solved! Go to Solution.
Now it work's perfectly 🙂 - Thank you very much.
/Lars
Hi @larshostrup ,
Do you want to keep the collection table with latest data from your CDS Entity?
Based on the needs that you mentioned, I think Timer control is a available solution for your scenario. I think single one Timer control could achieve your needs.
Set the Duration property of the Timer control to following:
3000
Set the AutoStart and Repeat property of the Timer control to following:
true
Set the OnTimerEnd property of Timer control to following:
Refresh(Borger);;Refresh(Borgerregistrering);;
Concurrent(
ClearCollect(Aureteborger; [@Borger]);
ClearCollect(
Nyborgercollection;
AddColumns(
Filter(
Borgerregistrering;
crea5_companycode = AU_CID;
Opholdstype = Opholdkategori;
Afsluttet = 0
);
"onavn"; 'Oprettet af'.'Fulde navn';
"TranspBillede";
LookUp(AureteTransport;cr9eb_tranid = Value(Transportype);Transportbillede)
)
)
)
In addition, as another solution, you could also consider fire a flow from your canvas app after updating records in your CDS Entity, then within the flow, pull latest records from your CDS Entity, then return the retrieved table records back to your app (using "Response" action).
Please check and see if the following blog or threads would help in your scenario:
https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/
https://powerusers.microsoft.com/t5/Building-Power-Apps/Read-Excel-Stored-in-SharePoint/m-p/327925
Within your app, you could store the result returned from your flow into a collection using the following formula:
ClearCollect(LatestCollection, 'Flow Name'.Run())
Best regards,
Now it work's perfectly 🙂 - Thank you very much.
/Lars
User | Count |
---|---|
252 | |
107 | |
90 | |
51 | |
44 |