Hi @Anonymous,
I've done the following to save timestamps for the last time they synchronized their data:
- Create a Sharepoint list with a email and timestamp column (both single text)
- Using the patch function you can store the data
Here is full code example of my timestamp saving:
If(
Connection.Connected,
Set(
localUserObject,
LookUp(
'TimestampTableSource',
Title=User().Email
)
);
If(
IsBlank(localUserObject),
Patch(
'TimestampTableSource',
Coalesce(
localUserObject,
Defaults('TimestampTableSource')
),
{
Title: User().Email,
Timestamp: Text( Now(), "[$-en-US]dd.mm.yyyy hh:mm:ss" )
}
),
Patch(
'TimestampTableSource',
localUserObject,
{
Timestamp: Text( Now(), "[$-en-US]dd.mm.yyyy hh:mm:ss" )
}
)
);
ClearCollect(
LocalUserStorage,
LookUp(
'TimestampTableSource',
Title=User().Email
)
);
SaveData(
LocalUserStorage,
"localUserStorage"
),
LoadData(
LocalUserStorage,
"localUserStorage",
true
)
)This codes saves the last timestamp a user has a connection. If not the data from the cache will be loaded.
I'm sure this could be more elegant but it works as expected.