How do I save a checked checkbox, even when user logs out then back in

Hi, I build websites so am completely new to app building. Any help would be hugely appreciated - thank you.

I would like to build an app that will be for sale as an app (preferably as an annual subscription fee), but without any in-app purchases. In other words, you pay one amount that recurs each year, and you can use the app as much as you like.

It is a group of specific checklists that I have written, that users can use to remind them to check off the items. The app must save the checked box, so the user can go back to the app and see what has been completed, and what is left to do.

I do not know how to get the app to save the check in the checkbox. This will obviously differ per user as they each follow the checklists at their own pace. Therefore I assume this data would be stored in their phone somehow, but I have no idea how to make this happen.

Are you able to help me please?

Thanks!!

I recommend to read the AppGyver docs: Configuring data resources - AppGyver :wink:

2 Likes

Thank you so much! I didn’t even know where to start…

I am soooo lost… Is there any way you could help me setup just 1 checkbox please, so it saves on the client’s device, and I will duplicate it?

You bind a Page Variable to the value of the checkbox and you can use ‘Set Item to Storage’ to save that value to the device. Then when the app is launched at startup you do a ‘Get Item from Storage’ to retrieve that value, where you can set the Page Variable that is bound to your checkbox equal to.

2 Likes

Thank you so much for your reply.

I am trying to follow your instructions and have watched the ToDo app tutorial about 3 times but I am missing something. The tutorial specifically allows you to create checklists - I wanted existing blank checklists that people can tick as they complete tasks.

I am still trying but honestly have no idea what I’m doing.

@Michelle_Fouche Just to clarify: You are wanting to add a checklist and store the data correct? And when the user comes back to the app the checklist will have the same checked or unchecked items?

1 Like

Hi Adam

That’s exactly it. I have zero experience and I know I’m not getting it right but I don’t know how to troubleshoot it, and I have never used the terminology before, so I was hoping someone could please help. Thanks!

There are probably several different ways to go about this…just a heads up haha.

If you don’t care about the users losing data if they delete the app, then you could probably get away with using On-device storage.

You would need to create an On-device storage data source and a couple pages. I am assuming you are using the built in navigation, but if not you will need to add some logic for the user to be able to go back to the first page.

ChecklistData Data Source

  • checklistName (text)
  • checklistItem (text)
  • value (true/false)

Page One

This would be your list of checklists. You would create these manually by dragging in List Items or whatever you want. You would need to add an Open Page function to each of these so that when the user taps on a checklist it would take them to the next page with the checklist items. You will need to pass the checklist name to the next page by using page parameters.

Page Two

This is your checklist page and we’re going to dynamically build it based on the selected checklist. Add a Page Parameter called ChecklistName.

Add a Data Variable called ChecklistData and select your On-device storage data source. You will need to filter this data by adding a filter and only return items that match the ChecklistName page parameter. I would also lower the delay time to like 1 second since it won’t be taking up a lot of resources.

Drag a Title component and set the value to your page parameter ChecklistName.

Drag a Checkbox component and set the Repeat with to your ChecklistData data variable. Then set the label (Data Item in Repeat → current → label) and value (Data Item in Repeat → current → value).

Logic

At this point you just need to build out the logic for creating the initial data and updating the ChecklistData whenever they check or uncheck an item. You could probably create all of the initial data when the app first launches using the Global View and a bunch of Create Record functions. If you get this far, then let me know and I’ll help if you have more questions.

2 Likes

Hi Adam

Thank you so much for your help!!

I have been working on this alll day and I think it’s improving, but I’m definitely missing something.

These things are really tripping me up:

  • You will need to pass the checklist name to the next page by using page parameters.
  • You will need to filter this data by adding a filter and only return items that match the ChecklistName page parameter.
  • Then set the label (Data Item in Repeat → current → label) and value (Data Item in Repeat → current → value).
  • You could probably create all of the initial data when the app first launches using the Global View and a bunch of Create Record functions.

I am still trying everything and Googling like mad, but I feel like I’m missing some pretty major steps!

Thank you again for all your help :slight_smile:

@Michelle_Fouche If you can give me till Monday I’ll make a short video explaining how I would do this. Thanks!

2 Likes

I’m interested in the same functionality.

I’ll wait for the video too.

Gratitude!

@Adam_Wike Thank you SO SO much!!! I REALLY appreciate the help.

@Michelle_Fouche @Leo_Sussuarana

As promised: AppGyver Offline Checklist - YouTube

Quality may suck for a little while until it finishes processing.

Hopefully this helps! I still recommend using a backend to manage all of your data instead of creating it locally, but hopefully this helps with the on device storage stuff.

Thanks,

Adam

2 Likes

Thank you so much for the help and the video. Thank you very much!

1 Like

@Adam_Wike You are a legend, thank you!! I am working through your video and can see now that what I was doing before was SO wrong… I haven’t quite managed to make it work yet but I’m about a hundred times closer. Thank you so much for taking the time to help. I will let you know when I get it right!!

1 Like

Adam thanks for the video. Subscribed and waiting for more content. If you could do a tutorial on how to make content fetched from airtable, available offline. So whenever the user opens the app, there’s no need to refetch all content from airtable if there’s no change.
Thanks again and keep it up.

Yeah, I can probably do something like that sometime soon :+1:t3: I’m thinking if you had a field in Airtable that kept track of when a record was last updated you could compare the most recently updated record to a local variable on your AppGyver app and when those two values no longer match you could fetch a fresh copy of the data. Once you fetch the data then you update your local variable so that its once again equal.

1 Like

So i followed this tutorial (funny thing is, till this day i never managed it to get it working, don’t know if it is a bug or I’m completely noob) but I don’t know if I’m doing something wrong.

Sorry for changing the subject of OP but i think this is related and a must feature if we use cloud backend.

I’ve stared at this for what seems like hours and I’m unable to get the Replace client side collection function to work correctly or at least as I think it should be working. I currently work around this by getting my data and then looping over it and using a create record function to store it on the device using the on device storage data source. It’s not as clean but it’s allowed me to store a couple hundred records fairly easily once the initial logic is setup. I have an app for paramedics and all their data has to be available offline.