Course · Build apps with AI · Session 2

Grow your app
(and learn to fix it)

You already have a deployed app. Now you will learn to identify an error, explain it to AI and check the fix. Then you will add one specific improvement, keeping what already works.

Format
Self-paced and online
Estimated time
About 2.5 hours, over one or more sittings
Essential
Diagnose an error, test an improvement and check access
Optional
Present your app in 5 minutes
One improvement at a time. Keep a copy of the working code and test with fictional data. In a chat, attach the current code: do not assume it can see your project files. Review the result, test it at /dev and update the existing deployment only when it works.
A convincing answer can still be wrong
AI may suggest a function that does not exist, outdated instructions or a fix that introduces another error. Ask what changed and how you could check it. If it says it ran tests, ask which ones and in what environment. Generated code does not prove the app works.

↩From Session 1: you already have a dining room / frontend (Index.html), a kitchen / backend (Codi.gs) and a pantry (your spreadsheet), deployed with a link. Today you are not starting again: you are building on your app.

This is an individual, self-paced online session. Take your time and work in several sittings if needed. At the end there is an optional task: prepare a 5-minute presentation of your best app if you would like to share it.
Step 0 · Which app will you improve?

Choose what you will work on today. This personalises all the prompts below.

The core skill · The loop

Test, read, fix

Coding with AI does not mean getting everything right first time. It is a loop: ask, test, read what happened, fix it and ask again. Record what you expected, what happened and how to reproduce it. Change one thing at a time.

Ask
give the AI a clear prompt
→
Paste
the code into your project
→
Test
check the result at /dev
→
Fix
if it fails, read the error
↩ and ask again until it works
Exercise: introduce an error and fix it ~20 min · essential✓▸

You will introduce a small, reversible error in a practice copy. The deployed app will stay available.

First, prepare the test copy
  1. Copy the Session 1 spreadsheet using fictional data and check that the Apps Script project was copied too. If not, create it and copy both files. Change ID_DEL_FULL to point to the test spreadsheet; keep the tab and column headers.
  2. Keep a copy of both working files. In Apps Script, open Deploy → Test deployments → Web app and copy the /dev URL. Check it opens before introducing the error.
Now break it and fix it
  1. If doGet() loads Index, rename only the HTML file from Index to Inici, without changing doGet(). Save and reload /dev. Record the exact message: the requested name no longer matches the file.
  2. Send the prompt below with the error, steps and code from the copy. Ask for the cause and the smallest fix. You do not need to replace two files if restoring the name Index is enough.
  3. Rename the file back to Index, save and open /dev again. Save a fictional entry and check it reaches the test spreadsheet. If you cannot recover it, restore the saved copy.
/dev and /exec are different. /dev runs the latest saved code and is accessible only to project editors. /exec runs the deployed version: saving in the editor does not update it. You do not need to deploy the broken code for this exercise.
The debugging prompt

Use this prompt whenever something goes wrong. Keep it handy.

Today’s lesson: making mistakes and fixing them is normal. Coding with AI is not about never making a mistake; it is about reading the error and asking the next useful question.
Choose one improvement · The others are optional

Choose an improvement to open a guide with a prompt tailored to your app. Start with design or search. Editing data, pagination and photos need more checks. You do not have to complete all six options.

Catalogue improvements applied: 0/6
Before sharing · Review security
Security, step by step ~10 min✓▸

Now that your app is online and may have users, spend a few minutes on these six basic habits.

  • Who can access it? Use “Only myself” for personal information; allow anyone only for forms designed for that audience. Do not open an app containing private data to everyone.
  • Do not expose other people’s data. In a public registration form, each person should see only their confirmation, not everybody’s names and email addresses.
  • Code can be shared; secrets cannot. In Session 3 you will take the code to GitHub. Do not include passwords or personal data.
  • Understand what you authorise. Accepting a Drive or email permission lets the app act on your behalf. Check its scope and which function needs it. Generating the code yourself does not make it safe; stop and ask for help if you do not understand it.
  • Consider spam. A public form can receive many submissions. If it collects important information, ask for validation or limits and test them.
  • Respect personal data. Names and email addresses belong to other people: use them only for the stated purpose and remove them when no longer needed.
Before using company data

Practise with fictional data and an authorised account. For real use, agree with the responsible person what data may be processed, who has access, which services are authorised and who will maintain the app. Workspace alone does not resolve permissions or data protection. See the business guide.

Ask the AI for a security review

The prompt helps identify risks. An AI review does not certify security: check the findings against the code and access tests.

The final step · Check access
Test the deployed version ~10 min✓▸

The app can remain private. Check that the right people can enter and see only the data they should.

  1. After testing the improvement at /dev, deploy a new version of the existing deployment and open the same /exec.
  2. On your phone, using the authorised account, test valid input, invalid input and the existing feature. Check the spreadsheet.
  3. Using another browser profile or an unauthorised account, check that a private app denies access. If your design is public, use fictional data to check it does not expose private lists or allow changes to other people’s records.
  4. Optionally, ask an authorised person to test it. Do not broaden access just to complete the course.
Optional challenge · Present your app in 5 minutes
Prepare your best app optional challenge✓▸

Explaining what you built helps you understand it. If you want to share it with family, colleagues or a course group, prepare a 5-minute presentation. Choose your best app and use this outline:

  1. What it does and who it is for (30 s): the idea in one sentence.
  2. Show it working (1–2 min): open the link and add an entry live.
  3. How you built it with AI (1 min): which prompt helped and which improvement you like most.
  4. What failed and how you fixed it (1 min): the loop. This is particularly useful for your audience.
  5. What you would add (30 s): your next improvement.
You do not need to explain the code. Describe the idea and the process: what you wanted, how you asked for it, what failed and how you solved it.

Record your checks in the change and test worksheet. You can also download it as Markdown.

Before you finish…

Today’s goal is not to add endless features: it is to improve your app independently and know what to do when it fails. Check these off:

My improved apps gallery

Your app link: the same address, with your improvements applied.

Remember: a good app does not start out perfect: it grows. It grows through testing, reading errors and asking again.
In the next online session: you will organise code and history in GitHub and work with VS Code in your browser through Codespaces, without installing anything locally. You can also use AI from the editor.

Check your understanding

This is for you, not an exam or a grade. Think through your answers, then compare them below.

  1. How do you test a fix without changing the deployed version yet?
  2. When the app fails, what do you do before sending anything to AI?
  3. Can AI edit your code? How do you apply an improvement?
See the answers ▾

1. Keep a copy, reproduce the error, review the proposal and test it at /dev. When it works, update /exec with a new version of the existing deployment.

2. Read the error and look for clues such as a file or line number. Then send it with the code.

3. In this session’s chat workflow, you apply the reviewed changes. An agent connected to files may edit them with the relevant permissions; that does not mean it has tested or deployed the app.