Hey everyone,
I’m working on a project where users might be in areas without internet, but they still need to fill out forms and submit data. I need the form to either submit in real-time when online, or save the data locally and then sync with the database once the user regains connection.
Does anyone have experience setting up something like this in WeWeb, or suggestions on how to handle offline form submission and syncing?
Thanks for any help!
Hi @Temitope.1
Users need internet to first access the WeWeb app, since it is a web app.
If they lose connection, I think you could do this by creating an array called pendingSubmissions, saving it in local Storage:
On page load: create workflow check if window.navigator.onLine = true && pendingSubmissions.length > 0
- Is internet available? (window.navigator.onLine)
- Are there saved submissions? (pendingSubmissions.length > 0)
If both are true, submit the data, then clear local Storage.
1 Like
Thank you, i thought about this. But for this to work they need internet connection. to be able to even access the Form