Create a To-do List App
Day 6 of #14DaysofNoCode
Max Haining
|
67 steps
|
6 minutes
Glideapps
1
Log in to your [Glide](https://glideapps.com/?utm_source=14daysofnocode-lesson&utm_medium=referral&utm_campaign=14daysofnocode) dashboard.
To complete this lesson, you'll need to upgrade to Glide's "Explorer" plan. Details of how to do this can be found[here](https://community.glideapps.com/t/100-days-of-nocode-ai-welcome-faqs/74604).
Create from template
2
Click '**New app**'
3
Select '**Basic App**'. \ \ This template will speed up the process of creating a to-do list app.
4
Click '**Create app**'.
5
By default, this template is set to a 'List' style. Change the style to '**Checklist**'.\ \ This will give you the functionality of changing the status of a note/task later on.
Customizing the database
6
You're now going to customise the data input for the app. \ \ Click '**Data**'.
7
You'll see that this template includes some test data, which you're going to customise.\ \ Click the **+ new field** button in the table.
8
Name this field '**Task**', ensure the 'Type' is set to '**Text**' and click '**Save**'.
9
Click and drag this field left until it appears as the first field in the table.
10
You're now going to create a 'Status' button which you can use to set a task to complete or incomplete within your to-do list.\ \ **Click the drop-down field menu** from the arrow button within the '**Name**' field.
11
Click '**Edit**'.
12
Change the 'Name' to '**Status**'.
13
Change the field type to '**Boolean**'.
14
Click '**Save**'.
15
Give the first 3 tasks in the table the task names 'Task 1', 'Task 2' and 'Task 3'. \ \ This is just for demonstration purposes as you're going to be testing the functionality of your app using these tasks in a moment.
16
Add 'Task 1'.
17
Add 'Task 2'.
18
Add 'Task 3'.
19
Click the '**Layout**' button at the top of the page to head back to the app editor.
Data mapping
20
You're now going to map the 'Task' field you added in the table to the item titles in your list.\ \ Click '**Collection**' from the left-hand menu.
21
In the right-hand menu, remove "**Status**" and replace it with "**Task**"
22
You'll see that the items in your app have now updated. The bold title for each item in the list is now mapped to the 'Task' field in the table that you just customised.\ \ The three tasks that you gave task names to should appear in the list. Items in the table without task names will just appear with short descriptions.\ \ You'll also see here that the '**Checked**' item data is automatically mapped to your '**Status**' table field. You'll see how this works in a moment.
Configuring the 'Task' screen
23
Click on the text of '**Task 1**'
24
You're now presented with the components and options specifically for this 'screen' within your app.\ \ Click the '**Title**' component.
25
On the right-hand side of the screen you'll see the options for this section of the screen.
26
Change the Title from "**Status**" to **Task**"\ \ This is because you want the Task name to appear in bold as the title on this screen.
27
Select the '**Fields**' component from the left-hand menu.
28
You're now going to add a new '**Switch**' component. \ \ This 'Switch' will be used to determine whether an item is complete or incomplete. You'll see how this works in a moment.\ \ Click the **+ button** next to 'Components'.
29
Search and select the '**Switch**' element.
30
You'll see that a Switch button has been added to this screen, and it's automatically mapped to the '**Status**' field in the database.\ \ Let's test it, so you can see how it works.
31
Click the back button on your app.
Testing the 'Status' functionality
32
Now you can test how this 'Status' switch works. \ \ Let's assume you've completed the task and want to cross it off your list.\ \ Click the checkbox on this screen and you'll see the item is now greyed out.
33
Now click the text within '**Task 2**' to be taken into the item.
34
Toggle the '**Status**' button on (assume for this app that toggling the button 'on' is marking it as complete).
35
Click the back arrow to go to the home screen.
36
You'll see the task is now greyed out within your items list.
37
Now let's see how this relates to the database.\ \ Click '**Data**'.
38
Check the box for '**Task 3**'.
39
Click '**Layout**' to head back to the app editor.
40
You'll see that 'Task 3' is also greyed out as it's been checked in your database (meaning it's complete).
Adding a 'delete note' function
41
You're now going to add a '**Delete**' button. \ \ This will allow you to remove items from the database by clicking on a button within the app.\ \ Enter '**Task 1**' from your app.
42
**Click the + button** next to '**Components**'.
43
Search and select the '**Button**' action.
44
You'll see a button is now added to the item screen.\ \ On the right-hand menu, select open the '**ACTION**' menu.
45
Change the button title to '**Delete Note**'
46
Click the drop-down icon menu.
47
Select the X icon.
48
Click the drop-down action menu.
49
Select '**Data**' > '**Delete row'**
50
Now, test to see if this action is working as expected by clicking the '**Delete Note**' button you just created for Task 1.
51
Go back to your app home screen and you will see that Task 1 no longer appears.\ \ Now, delete each item without a task name.
52
Click '**Data**'.
53
You'll see that everything is functioning as expected as these items have been removed from your database. \ \ Click '**Layout**' to head back to your app.
Adding a home screen title
54
Now let's give your app a tiny bit of customisation by adding a heading at the top of the home screen.\ \ **Click the + button** next to 'Components'.
55
Search and select the '**Headline**' component.
56
Drag the 'Headline' component to the top of the components list. You'll see that this will bring it to the top of your app's home screen.
57
Using the option from the right-hand menu, **centre align this headline.**
58
**Now change the headline text** to '\[your name\] to-do list'
59
Select the drop-down menu for the headline style.
60
Click "**Headline XLarge**"
Adding a new item
61
Great, almost there...\ \ You're now going to test how your app works when adding a new item.\ \ **Click the + icon** on the home screen.
62
In this '**Add item**' screen you'll see that the component is incorrectly mapped to the 'Status' field.\ \ You now need to correctly map this component.\ \ Select the 'Text Entry: Name' component from the left-hand menu.
63
On the right-hand menu, click the drop-down menu in the '**Column**' field.
64
Select '**Task**'.
65
Now fill in all the fields for an item.
66
When you're ready, click '**Submit**'
67
Boom 💥 you've got a functioning to-do list app!\ \ Today you've got hands on with the front end and back end development of a to-do list app in Glide. \ \ You've customised the app to clearly mark completed items, you've mapped components to items in the app's database, and you've configured a component with an action to delete items from the database.\ \ Great work today. 👏👏👏\ \ If you want, you can publish your app by clicking the '**Publish**' button in the top-right hand corner of the screen and following the instructions.