Build a dynamic pricing calculator app
Quote Northwind customers in real time — pick options, see the price update live.
Published Sep 9, 2025
Quoting takes too long. A prospect asks “roughly what would this cost?”, and the answer waits for someone at Northwind to find the rate card, do the sums, and email back — by which time the prospect’s enthusiasm has cooled. A simple self-serve calculator turns that lag into an instant answer.
This is a small web app: a page with a service dropdown and a rush-job checkbox. Pick options and the total updates live in the browser — no page reload, no server round-trip. Share the link, and prospects get a ballpark figure in seconds while the studio gets fewer “how much?” emails.
What you’ll need
- An Apps Script project with two files: a script file and an HTML file named
Pricer(the names must match thecreateHtmlOutputFromFilecall). - Your real prices — the figures below are placeholders. Edit the dropdown options and the rush multiplier to match Northwind’s rate card.
- Permission to deploy the project as a web app.
The HTML (Pricer.html)
<form id="p">
<label>Service:
<!-- Each option's value is the base price in pounds. -->
<select id="service">
<option value="500">Brand audit (£500)</option>
<option value="2000">Brand refresh (£2,000)</option>
<option value="6000">Full identity (£6,000)</option>
</select>
</label>
<!-- Ticking this applies the rush surcharge. -->
<label>Rush turnaround? <input type="checkbox" id="rush"></label>
<p>Total: £<span id="total">500</span></p>
</form>
<script>
// Rush jobs add 40% to the base price.
const RUSH_MULTIPLIER = 1.4;
// Recalculate the total from the current form state.
const update = () => {
const base = +document.getElementById('service').value;
const rush = document.getElementById('rush').checked;
const total = base * (rush ? RUSH_MULTIPLIER : 1);
document.getElementById('total').textContent = total.toLocaleString();
};
// Recalculate whenever any field changes.
document.querySelectorAll('select, input')
.forEach((el) => el.addEventListener('change', update));
</script>
The script
/**
* Serves the pricing calculator page when the web app is opened.
* All the pricing logic runs in the browser — this just returns
* the HTML file.
*/
function doGet() {
return HtmlService.createHtmlOutputFromFile('Pricer')
.setTitle('Northwind — pricing calculator');
}
How it works
doGetruns when someone opens the web app’s URL. It returns the contents ofPricer.htmlviaHtmlServiceand sets a browser tab title.- The HTML page is self-contained — a
<select>of services and a rush checkbox, with the running total shown in a<span>. - Each
<option>’svalueattribute holds its base price in pounds, so the selected price is read straight from the dropdown. - The
updatefunction reads the chosen base price, checks the rush box, and multiplies byRUSH_MULTIPLIER(1.4) when rush is ticked. toLocaleStringformats the number with a thousands separator, so £6,000 reads as6,000.- An event listener on every
selectandinputcallsupdateon any change, so the total recalculates instantly — entirely in the browser, with no call back to Apps Script.
Example run
Open the deployed link and the page starts on the cheapest option:
| Service selected | Rush? | Total shown |
|---|---|---|
| Brand audit (£500) | no | £500 |
| Brand audit (£500) | yes | £700 |
| Brand refresh (£2,000) | no | £2,000 |
| Full identity (£6,000) | yes | £8,400 |
Every change updates the figure the instant the dropdown or checkbox moves.
Run it
Deploy the project as a web app so it has a shareable URL:
- In the Apps Script editor, click Deploy → New deployment.
- Choose type Web app.
- Set Execute as to yourself, and Who has access to Anyone so prospects can open it without a Google sign-in.
- Click Deploy, approve the authorisation prompt, and copy the web app URL.
- Share that URL — open it yourself first to confirm the page loads.
Watch out for
- The prices live in the HTML, visible to anyone who views source. This is a public ballpark tool, not a place for confidential or negotiated rates.
- Nothing is saved. The calculator only displays a figure — it does not record the quote or capture who asked. Add a Sheet-backed submit step if you need a lead trail.
- All the maths runs client-side, so the page is fast but unverified. Treat the number as an indicative estimate, not a binding quote.
- Update the deployment after editing. Apps Script serves the version from the last deployment — use Deploy → Manage deployments → Edit and pick the new version, or the live app keeps the old prices.
- “Anyone” access means truly anyone with the link. If quoting should stay internal, set access to your domain instead.
Related
Build a branded approval interface
Approve Northwind requests through a custom UI — clients click, decision is logged.
Updated Nov 8, 2025
Build an interactive quiz or assessment app
Run Northwind tests with scoring and feedback — questions in a Sheet, results in another.
Updated Nov 4, 2025
Build a multi-page web app with routing
Structure a real Northwind app across views — query-param routing, shared layout.
Updated Oct 31, 2025
Build a form-to-PDF web service
Convert Northwind form submissions to PDFs on the fly — POST in, PDF out.
Updated Oct 27, 2025
Build an expiring secure-download generator
Issue time-limited Northwind links via a web app — token in URL, server-side check.
Updated Oct 23, 2025