Way to tell whether record has synched?

Is there any way to filter out synched from non-synched data? eg. One view shows all records that were successfully synched and the other shows those that have not been (yet).

Not trivially. If you attach a modify DateTime (e.g, a ChangeTimestamp column) to each row and track the last sync time, you could compare the two.

Hmm… messy.

@Jethro what’s the problem?

1 Like

Hi Steve, thanks,

How do I refer to “last synch time” in an expression? Is it possible?

I agree its a bit messy. Its just that our users are collecting thousands of records a month and primarily once they have collected and synched the record, they wont need it anymore. Maybe a Today() filter would work better in this case while they are in the field so it looks neat each day and i figure out a way to deal with the issue in the backend database (eg. a nighttime scheduled shift of all synched data to another table) so that when they start the next day, their synched data isnt visible.

Create a virtual column with an app formula of NOW(). That column value will contains the time of the last sync. For maximum efficiency, best to add the virtual column to a table with only one (or very, very few) rows. For instance, if you have a table named AppSettings with only a single row containing app-wide settings, you could name this column SyncWhen and refer to it in expressions as ANY(AppSettings[SyncWhen]). A row in an arbitrary table that has a ChangeTimestamp column named ChangeWhen could be presumed synced if [ChangeWhen] <= ANY(AppSettings[SyncWhen]).

Steve:

Create a virtual column with an app formula of NOW() . That column value will contains the time of the last sync.

Actually this value will constantly update as you use the app.


Jethro:

Maybe a Today() filter would work better in this case while they are in the field so it looks neat each day and i figure out a way to deal with the issue in the backend database (eg. a nighttime scheduled shift of all synched data to another table) so that when they start the next day, their synched data isnt visible.

It seems like you need a way to reduce the data in your users app: why not use a security filter?

date([Creation_Timestamp]) = today()

This way only the records that have “today’s” date are shown.

1 Like

Thanks, but will this truly reduce the data in their app or just hide the data that is still on their phone (eg. photos etc.) Would there be a safe way to have them manually delete all their pictures after their last synch for example.

Btw yes, trying to save phone resources + performance by lightening data on the phone from time to time.

MultiTech_Visions:

Actually this value will constantly update as you use the app.

Not in my experience. VCs with NOW() are updated only when syncs occur, as all other VCs.

1 Like

@Steve This is really good to know!!! Thanks!!

1 Like

Jethro:

will this truly reduce the data in their app or just hide the data that is still on their phone

Using a security filter will theoretically remove row data from the device. Slice filters only hide data while keeping it on the device.

1 Like

I guess I was projecting the fact that any normal app formula in a virtual column recalculates itself as you use the app, not just when you sync, onto the NOW() formula inside a virtual column.

For instance:

select(order_details[ChildID], [Parent_Link] = [_thisrow].[ParentID])

inside a virtual column will update constantly (well… not technically CONSTANTLY, but relatively constant).

2 Likes