Hi all,
I’m trying to create pre-defined checklists that all users can access. Each checklist will have a variety of tasks that can be independently ticked off. However, I am struggling to understand how I store an individual users progress on each task.
I’ve got my checklists created, and I can successfully list them in a repeating group and then when one is clicked anopther repeating group appears with the tasks. When I add a checkbox to each task, that’s where I get stuck!
Any help?
Thanks!
You can achieve this by creating at base template of item, like checklist which is a list of item with filed anything you want. and inside user create completed_item whichnis a field type as checklsit which is a list.
now as user clcik on checklist add that item inside user completed item.
you can search for checklist and show the list of item to user and if user hwve that item inside completed_item list mark it as complete
Here’s how I would do it:
Create a thing called “Checklist”, create another thing called “Checklist Item”
On your data type “Checklist” create a field called “Items” which will be of type “Checklist Item”.
On your checklist item data type, have a field called “Is Completed” of type “Yes/No”.
You can display the Checklist’s Checklist Items in a repeating group, and change the “Yes/No” field however you would like.
Doing it this way allows you some flexibility to create different checklist types later.
Other’s may have more efficient or better ideas, that’s just how I would do it.
I wouldn’t store the checklist on the user as it could get quite long and is quite limiting. It’s a good approach if the list is short but even then I’d store it on a user_detail or something so it isn’t always loaded to every page (user is always downloaded).
I recently set this up for a rather complex app and the basic structure was this:
checklist (stores a list of checklist items and allows drag drop reorder, makes it easy for reuseables and having multiple checklists on a data etc)
checklist item (name, detail, checklist)
user_checklist_item (checklist, checklist_item, user, completed date)
reuseables:
checklist creator
user checklist
checklist item editor
on my data types I add a field to hold the checklist
the checklist then holds the checklist items
on the user checklist I do 2 searches
1 to get the checklist and its items (the template)
2 to get the users completed items
then I use condition - this rows checklist_item is in users checklist (add/delete on complete/undo)
another alternative is to pre-create the users checklist items at some point
then you could just do 1 search and the date_complete would be the condition for each item
compare a list creates the user_checklist only on completion and in my case would use less wu - but it depends on your use case as to what would be best.
so 3 methods
- store completed on a list on a data - good for small lists but doesn’t log the date completed etc
- create checklist item for user before completion then mark is done/not done
- create checklist item for user at completion and delete (can do soft delete for logging purposes) if uncompleted
** there are also ways to reduce the checklist_item search if you store it on a thing ie pages things checklist
the users_checklist will need to be searched though unless stored on user_detail or similar
keep in mind that lists on things are generally best at 100 or less and a search is usually more performant after that