cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AVTS
Super User
Super User

Collections last Synchronization Date and Time

Experts,

I'm transferring data from flow (Getpmo) to the powerapps collection (test8). I'd want to show the final data downloaded into the collections. Like Last synchronization data and time 

 

The following code is used in the buttonclick.

 

If( Connection.Connected,
ClearCollect(test8,Getpmo.Run());
SaveData(test8, "MyLocalData");,
LoadData(test8, "MyLocalData", true )

 

Sample Expected layout  output . 

 

AVTS_0-1640261247437.png

 

How to achieve this.

2 ACCEPTED SOLUTIONS

Accepted Solutions
iAm_ManCat
Super User
Super User

Hi,

 

Just have a separate variable and storage for dealing with the last submitted time:

 

If(
   Connection.Connected
   ,
   ClearCollect(test8,Getpmo.Run());
   ClearCollect(test8_synctime, Now());

   SaveData(test8, "MyLocalData");
   SaveData(test8_synctime, "MyLocalDataLastSyncTime")
   ,
   LoadData(test8, "MyLocalData", true );
   LoadData(test8_synctime, "MyLocalDataLastSyncTime", true )
)

 

Then use test8_synctime for your 'last synchronisation' label,

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Hi,

 

Yes, happy to help

 

As we are storing this in a collection you can't just reference it directly, it is stored within a collection and is the only item in the collection so we need to use the First() function to pull back the stored value:

 

Text(
     First(test8_synctime).Value,
     "ddmmyyyyhhmss"
)

 

Please could you try that and let me know if that works for you,

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

7 REPLIES 7
iAm_ManCat
Super User
Super User

Hi,

 

Just have a separate variable and storage for dealing with the last submitted time:

 

If(
   Connection.Connected
   ,
   ClearCollect(test8,Getpmo.Run());
   ClearCollect(test8_synctime, Now());

   SaveData(test8, "MyLocalData");
   SaveData(test8_synctime, "MyLocalDataLastSyncTime")
   ,
   LoadData(test8, "MyLocalData", true );
   LoadData(test8_synctime, "MyLocalDataLastSyncTime", true )
)

 

Then use test8_synctime for your 'last synchronisation' label,

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Hi thanks you response. i am getting following error while assign in to the table text field ,

AVTS_0-1640764794733.png

 

 

 

Hi,

 

Could you show your formula please? The error is indicating that there is a formula error, and when I tested it on my side it worked correctly,

 

Many Thanks,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Text(test8_synctime,"DDMMYYYYHHMMSS")

AVTS
Super User
Super User

Clearcollect results looks correct . But when you are trying the display it in any label then its now coming correctly. 

 

ClearCollect(
test8_synctime,
Now()
);

 

What is the correct label formula to display the clearcollect date and timing details 

Hi,

 

Yes, happy to help

 

As we are storing this in a collection you can't just reference it directly, it is stored within a collection and is the only item in the collection so we need to use the First() function to pull back the stored value:

 

Text(
     First(test8_synctime).Value,
     "ddmmyyyyhhmss"
)

 

Please could you try that and let me know if that works for you,

 

Cheers,

Sancho

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


thank you @iAm_ManCat 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,190)