Make your app — and the spreadsheet behind it — legible to agentic AI
In the AppSheet editor, some connections between components are fairly easy to trace. If you turn the visual editing toggle on in a Detail view, for example, you shouldn't have much trouble determining what columns or actions are being displayed. Other kinds of connections are much harder to investigate. Determining what actions or columns rely on a particular column, for example, can be quite difficult, particularly if your app is large.
This suite of scripts helps you overcome this problem by converting your app's definition (the "Documentation" page) and the Google Sheets workbook it is built on into structured files. This makes it possible for an AI coding agent such as Claude Code or Codex to analyze your data and answer a wide variety of questions about the connections between components of your app.
The suite of scripts and associated files makes up a single GitHub repository that you download together. The repository contains scripts that parse your AppSheet data (the HTML documentation file), scripts that facilitate the capture and parsing of your Google Sheets data, and markdown files that tell agentic AI how to run the scripts and then analyze the data.
The list of things you need to do in order to prepare your data for analysis is relatively short:
Each of these is described in detail under Setup below.
I think you'll find the combination of the parsed files and agentic AI to be a powerful analytic tool. Please be aware, however, that responses can take time (usually minutes, not seconds). Moreover, depending on the tasks you set and the AI model you use, queries can consume large numbers of tokens. Please experiment with relatively simple tasks run by somewhat less powerful AI models and monitor your usage before you give complicated tasks to the most advanced AI models.
I released the first version of this suite in September of 2025. It began as a set of Python scripts that parsed an AppSheet app's documentation page into CSV files and then looked for orphaned components — views, actions, columns, slices and format rules that nothing in the app used any more. Such "orphans" occur when parent components are deleted or changed, and the AppSheet platform is particularly susceptible to the accumulation of such leftovers because, as indicated above, connections between components can be difficult to trace.
This update adds two things. The Google Sheets workbook your app is built on can now be parsed as well, so questions that cross between the app and the spreadsheet can be answered. And running the scripts is no longer something you have to do yourself: agentic AI can run the parsers, read the results, and then carry out whatever analysis you call for in ordinary language, presenting its findings in the form you designate. The addition of the Sheets data and an agentic AI interface extends the analytic capabilities of the scripts far beyond the identification of possible orphans.
Here are some of the kinds of things you can ask an AI agent to do once your data has been parsed. The list is not exhaustive; it is meant to give you an idea of what becomes possible.
The scripts themselves do not answer most of these questions. What they do is work out the relationships between components — which action is attached to which column, which views display it, which spreadsheet columns feed which — that are not readily apparent in the documentation page or in your Google Sheets workbook. With those relationships worked out, the AI can do the analysis. So the range of questions you can ask is not limited to the ones I had in mind when I wrote the scripts.
The AppSheet editor can produce a documentation page for your app: a single HTML page that describes its tables, columns, views, actions, slices and format rules. The scripts parse that page into CSV files, one per component type, and then run a set of "orphan detectors" that look for components nothing else uses.
If your app is built on a Google Sheets workbook, a second set of scripts makes the workbook readable too. This involves two separate steps, and it helps to keep them distinct, because both produce something you might call "the sheet data."
The first step is the capture. You paste a short Apps Script into your workbook and run it. It writes out two files: one containing every formula in the workbook and one containing every value. Nothing is interpreted at this stage, and the files stay on your computer.
The second step is the derivation. Scripts on your computer read those two files and produce the files that AI actually works from: an inventory of every distinct formula pattern in the workbook, a description of each sheet's structure, a graph showing which columns depend on which, a list of references to sheets that don't exist, and a comparison of your app's column names with your sheet's header labels.
Finally, a script connects the two halves of the suite to allow AI to trace how the AppSheet app and the Google Sheets workbook interact.
There are three types of information that the scripts cannot capture. Two types concern your app, one concerns your spreadsheet.
Bots. Bots are absent from the documentation page entirely — not just their steps, but the events that trigger them. The optional bot_actions.txt file lets you list the actions your bots call, one per line, so they are not reported as unused. However, nothing about how your bots actually work is available for analysis; your AI cannot determine whether a bot is ever triggered, or whether a bot has itself become redundant. Questions such as those remain yours.
View display names. A view's Display Name is a real field in the AppSheet editor, but it is not included in the documentation page — each view record carries ten fields and that is not one of them. So if you have renamed a view, the parsed data knows it only by its internal name, and nothing indicates which views have been renamed. When AI tells you about a view called Stats_Detail, please bear in mind that this may not be what the label says on screen.
Scripts bound to your spreadsheet. A script attached to your workbook — one running on a trigger, or on edit — can write values into cells, but the capture includes neither the script nor any indication that it exists. Its output looks like any other column of values with no formula behind it. This is the spreadsheet-side counterpart of the bot problem: something may be acting on your data that the captured files do not contain, and a trace that reaches such a column stops there.
More generally, the scripts can tell you whether a path to a view or action exists in your app's definition, but not whether it will actually be available when the app is used. The scripts do not take into account conditions that depend on your data or a column's Show_If setting. Your AI agent can often reason about such conditions, using the expressions themselves and, if you captured your spreadsheet, the values it held at the time of the capture. Before deleting anything on the basis of your agent's findings, however, please make a backup copy of your app, do your best to confirm that the components are not needed, and bear in mind that mistakes can occur.
These and other problems are listed in the STATUS.md file in the repository. The file is intended to be read by your AI agent but, of course, may be of interest to users as well.
If something goes wrong when you run the scripts on your own data, please ask your AI agent to prepare a report on the problem. It will refer to AGENT_REPORT_FORMAT.md in the repository and prepare a report that should be sufficient to allow me, with my own AI agents, to identify and correct the problem. Please send the report to me (Kirk_Masden) in a personal message on the AppSheet Community forum. This will help me improve the scripts and/or documentation for the benefit of other users.
Go to the repository on GitHub, click the green "Code" button, and choose "Download
ZIP." Extract the ZIP file. You will get a folder called
appsheet_parser_and_orphan_detector-main.
Create a folder to work in (for example, AppSheetAnalysis) and move the
extracted folder into it. Everything else described below goes in that same working
folder.
You can do this from either the current AppSheet editor or the legacy editor. Open your app, click "Settings," then "Information," and scroll to the bottom of the page. You will find a link to the documentation page for your app. Open it and save it from your browser as "Webpage, HTML Only."
Do not rename the file. Keep the name AppSheet gives it (something
like Application Documentation.html). The folder you put it in is what
identifies which app it belongs to.
These are made from the legacy editor, not the current one. The documentation page in step 2 can come from either editor, but the pages you copy text from in this step exist only in the legacy editor.
You need three files: actions.txt, views1.txt and views2.txt. Each one is made the same way: open a page in the legacy editor, select all the text on it, copy it, and paste it into a text file. Nothing has to be typed, but the settings on the page before you copy do matter (which checkbox is checked, for instance), so please follow the instructions carefully. A fourth file, bot_actions.txt, is optional and is made differently — by hand, from the current editor — as described at the end of this step.
actions.txtVideo Tutorial: Watch how to create actions.txt:
These files help identify system views and navigation structure. You need to create TWO separate files:
For views1.txt:
views1.txtFor views2.txt:
views2.txtIf your app uses bots that trigger actions, create this file to prevent those actions from being incorrectly identified as orphans:
bot_actions.txtExample bot_actions.txt:
Send_Email_Notification
Update_Status
Archive_Old_Records
If you want AI to be able to read your spreadsheet as well as your app, open the
workbook your app is built on, and from the Extensions menu open Apps Script. Paste in
the contents of sheet_capture.gs (from the folder you downloaded in step
1), save it, and run the function captureWorkbook. The first time you run
it, Google will ask you to authorize the script; this is normal for any script you
paste in yourself.
The script writes two files, one for formulas and one for values. It puts them in a
folder called sheet_dumps in your Google Drive; if the folder isn't there
already, the script creates it. Open that folder and download both files to your
computer. Their names include the name of your workbook and the date and time of the
capture, and you do not need to rename them.
Inside your working folder, create a folder called apps. Inside that,
create a folder for the files to be parsed. You can name it anything you like, but a
name like MyApp_20260914_101500 (app name plus date and time) is
recommended. The output folder created later will be given the same name, so the two
are easy to keep together, and if you analyze the same app again after making
changes, the date and time keep the folders apart.
Put all of the files you have prepared directly in that folder, with no subfolders:
AppSheetAnalysis/
├── appsheet_parser_and_orphan_detector-main/ (the extracted suite)
└── apps/
└── MyApp_20260914_101500/
├── Application Documentation.html
├── actions.txt
├── views1.txt
├── views2.txt
├── bot_actions.txt (optional)
├── MyWorkbook_formulas_20260914-101500.json (from step 4, if you did it)
└── MyWorkbook_values_20260914-101500.json (from step 4, if you did it)
Please keep one app export and one spreadsheet capture per folder, so that the two
always belong together. When the analysis is run, the results go into a matching
output folder. The suite includes a command that reports which of the
expected input files it found and which it did not; your AI agent can run it for you,
and it is worth doing before you start asking questions.
The two capture files are recognized by their names. You do not need to rename
them, but if you do, all that matters is that one name contains the string "formulas"
and the other contains the string "values", in lower case, and that both end in
.json; the rest of the name is ignored, so formulas.json and
values.json would do.
Start your AI agent and give it two paths: the directory you made in step 5, and the markdown file in the folder you downloaded in step 1 — CLAUDE.md if you are using Claude Code, or AGENTS.md for other agents. The markdown file tells your agent what the scripts do, how to run them, and what they cannot see; the directory is the data you want analyzed.
The scripts are written in Python and use one additional library, beautifulsoup4. Your agent will install these if they are not already on your computer (with your permission, of course, if not previously granted), so there is nothing for you to set up in advance. If you would prefer to run the scripts yourself rather than through an agent, see "Running the scripts yourself" below.
As indicated above, the suite is designed to be used through an AI coding agent. Claude Code, Codex and Gemini CLI all work. The agent reads the parsed files, runs the analysis scripts, and answers your questions in plain language. You can also run the scripts yourself from a terminal and read the CSV files directly, but the agent is the main way the suite is meant to be used.
Two files in the downloaded folder tell the agent what it needs to know:
CLAUDE.md for Claude Code, and AGENTS.md (identical in
content) for other agents. They explain what each file contains, which script answers
which kind of question, and what the scripts cannot see. Claude Code reads
CLAUDE.md automatically if you start it in the downloaded folder;
otherwise, or with another agent, give it the path to the file.
Then tell the agent where your data folder is (the one you made in setup step 5) and ask your question. Some examples:
What to expect in terms of response time and cost in tokens (AI usage):
Every script in the suite is an ordinary command-line program and can be run from a terminal, and the CSV files they produce can be opened in a spreadsheet. The commands, along with the virtual environment the scripts need, are documented in README.md in the repository.
The original documentation page is also still available. It describes the version released in September 2025 and includes the Mac and Windows command sequences, a description of what each module covers, and the interactive dependency analyzer. Please note that the setup procedure it describes has since changed.
The repository contains detailed documentation of every script in the suite: what each one parses, what it produces, and what it cannot see. These files are written for your AI agent, which reads them before it does anything, but they are plain text and you are welcome to read them yourself. You can also simply ask your agent, which will answer specific questions based on what these files contain.
MIT License. Written by Kirk Masden, with Claude.
Repository: https://github.com/KirkMasden/appsheet_parser_and_orphan_detector