Data Slice not working when offline

I made a clock-in and clock-out app for a business and have the app running on a phone as a little kiosk. They ran into an issue today when an employee tried to clock in. They submitted a form for the clock-in and once they did, their name didn’t show up in the list (a view of a data slice) and it showed that there was an item that needed to sync.

When looking into all of the offline settings, these are the things that I have set currently.

This is the expression for the data slice:

and(ISBLANK([End Time]),ISNOTBLANK([Start Time]))

In looking over documentation and such and doing some tests on this app, I have concluded that the app does indeed store the data locally while in offline mode (to the timesheet table that can be viewed elsewhere in the app), but the data slice doesn’t seem to update while it is offline.

From some of the AI-powered searches I have done on multiple platforms, it says that the data slice should still be able to evaluate even when offline.

Has anyone else experienced this same thing? If so, were you able to fix it? Are my settings correct or do I need to change something?

Slices work fine when the app is offline. None of the configuration in your screenshots affect slices at all.

Please post screenshots of:

  • the columns list for the table
  • the configuration of the slice
  • the configuration of the form view used to clock-in
2 Likes

I can confirm slice filters are evaluated locally on the device. However I can’t speak to why it would fail to show the new record in this case. Is the problem happening with every new form entry, or just affected one? Is it possible the user accidentally filled the [End Time] field or didn’t fill the [Start Time] field?

2 Likes

Ok, I ended up figuring this out and want to post my findings for anyone else who runs into this issue.

I ended up making a copy of the app and then slowly deleted stuff until it ended up working.

I had a formula that would input the time when an employee went to clock out. Here was the expression.

if(CONTEXT(“View”)=Clock Out_Form,NOW()," ")

Turns out, Appsheet didn’t like this when trying to run offline, but it worked when online. It wanted the “value if false” term to also be a datetime, so I just had to update the expression to:

if(CONTEXT(“View”)=Clock Out_Form,NOW(),DATETIME(" "))

:roll_eyes::roll_eyes::roll_eyes::roll_eyes:

Such a silly little thing to have to change to make it work.

1 Like

This is equivalent:

IFS(CONTEXT(“View”)=Clock Out_Form,NOW())
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.