TurboManage

David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler

    Unknown's avatar

    Google Cloud Platform Data Engineering Instructor now residing in Tennessee with the wife of my youth (34 years). Besides tech, I enjoy aviation and landscape photography. I am currently offering pro bono consulting and software development to missions organizations and non-profits at MercyGeeks.com.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 216 other subscribers

AppSheet + Gemini is a game changer

Posted by David Chandler on October 7, 2026

I’ve long been fascinated with CRUD (create, read, update, delete) tools. In fact, the name of this blog was originally the name of a tool I created in ColdFusion circa 2007 to build Web interfaces dynamically based on a data model. The concept was very similar to what AppSheet does today as well as AirTable and others, albeit AppSheet also builds mobile interfaces. I’ve previously used Intuit Quickbase and was surprised to find when I joined Google in 2010 that Google had no such tool, even for internal use. Later, Google introduced (and then cancelled, argggh) Tables by Area 120. And in 2020, they bought AppSheet, a CRUD tool that lets you turn any spreadsheet into a cross-platform mobile and Web app.

When I first tried AppSheet, I didn’t like it at all. If what you get out of the box is good enough for you, it works pretty well. But once you start customizing, you find that you have to do a lot more customizing to carry an idea all the way through. For example, you can filter data using a slice, but then you’ll probably need a custom view and custom actions to override the default AppSheet behavior for the table on which your slice is based. None of this obvious when you start. Creating search interfaces is particularly onerous until you give up and use the built-in search icon in the menu bar, which is actually great.

Now, however, Gemini changes all that. As you can see in the screenshot below, you can use Gemini in the sidebar while doing AppSheet development to get in-depth suggestions and problem resolution for your specific AppSheet app.

This summer, I built several apps for a missions aviation organization in Alaska. AppSheet was a good fit because 1) much of their data was already in spreadsheets, and 2) they needed a mobile interface with offline capabilities (as an aside, Starlink is destined to own all communications in Alaska, but not everyone has it yet). The big question was whether AppSheet could handle the most important graphic in a flight plan, the weight and balance diagram. I was frankly at a loss how to do this. AppSheet has a basic charting library, but you can only create charts as standalone views.

Gemini to the rescue! Gemini not only suggested using an SVG, which AppSheet supports in a details view like the one you see in the screenshot above, but also wrote the entire one-page formula to build the required XML defining the SVG. That is pure “toil,” as Google calls it. I likely would have given up after a couple days of trying to match angle brackets and quotation marks. Instead, I spent about half a day prompting Gemini to include labels and to scale appropriately regardless of an aircraft’s size and weight. Here is the resulting SVG formula so you can appreciate the power of this combination:

CONCATENATE(
  "data:image/svg+xml;utf8,<svg xmlns=""http://www.w3.org/2000/svg"" viewBox=""",
  ROUND(MIN([WB Envelope][CG]) * 300 - 600), " ",
  ROUND(0 - (MAX([WB Envelope][Weight]) + 600)), " ",
  ROUND((MAX([WB Envelope][CG]) - MIN([WB Envelope][CG])) * 300 + 1800), " ",
  ROUND((MAX([WB Envelope][Weight]) - MIN([WB Envelope][Weight])) + 1400),
  """ width=""100%"" height=""100%"" style=""background-color: white;"">",

  "<text id=""label-title-weight"" x=""", ROUND(MIN([WB Envelope][CG]) * 300),
  """ y=""", ROUND(0 - (MAX([WB Envelope][Weight]) + 350)),
  """ font-family=""sans-serif"" font-size=""200"" font-weight=""bold"" fill=""gray"" text-anchor=""start"">Gross Weight (lbs)</text>",

  "<text id=""label-title-cg"" x=""", ROUND(MAX([WB Envelope][CG]) * 300 - 2500),
  """ y=""", ROUND(0 - (MIN([WB Envelope][Weight]) - 600)),
  """ font-family=""sans-serif"" font-size=""200"" font-weight=""bold"" fill=""gray"">CG (inches)</text>",

  "<text id=""tick-w-min"" x=""", ROUND(MAX([WB Envelope][CG]) * 300 + 150), """ y=""", ROUND(0 - (MIN([WB Envelope][Weight]) - 50)), """ font-family=""sans-serif"" font-size=""160"" fill=""gray"" text-anchor=""start"">", ROUND(MIN([WB Envelope][Weight])), "</text>",
  "<text id=""tick-w-max"" x=""", ROUND(MAX([WB Envelope][CG]) * 300 + 150), """ y=""", ROUND(0 - (MAX([WB Envelope][Weight]) - 50)), """ font-family=""sans-serif"" font-size=""160"" fill=""gray"" text-anchor=""start"">", ROUND(MAX([WB Envelope][Weight])), "</text>",
  "<text id=""tick-cg-min"" x=""", ROUND(MIN([WB Envelope][CG]) * 300), """ y=""", ROUND(0 - (MIN([WB Envelope][Weight]) - 350)), """ font-family=""sans-serif"" font-size=""160"" fill=""gray"" text-anchor=""middle"">", ROUND(MIN([WB Envelope][CG])), """</text>",
  "<text id=""tick-cg-max"" x=""", ROUND(MAX([WB Envelope][CG]) * 300), """ y=""", ROUND(0 - (MIN([WB Envelope][Weight]) - 350)), """ font-family=""sans-serif"" font-size=""160"" fill=""gray"" text-anchor=""middle"">", ROUND(MAX([WB Envelope][CG])), """</text>",

  "<polygon id=""envelope-polygon"" points=""",
  SUBSTITUTE([WB Envelope][SVG_Point], " , ", " "),
  """ fill=""lightgreen"" stroke=""darkgreen"" stroke-width=""3"" vector-effect=""non-scaling-stroke"" opacity=""0.4"" />",

  "<circle id=""takeoff-dot-blue"" cx=""", ROUND([Takeoff CG] * 300),
  """ cy=""", ROUND(0 - [Takeoff weight]),
  """ r=""80"" fill=""blue"" stroke=""white"" stroke-width=""2"" vector-effect=""non-scaling-stroke"" />",

  IF(
    OR(ISBLANK([Landing CG]), [Landing CG] = 0),
    "",
    CONCATENATE(
      "<line id=""flight-vector-dashed"" x1=""", ROUND([Takeoff CG] * 300),
      """ y1=""", ROUND(0 - [Takeoff weight]),
      """ x2=""", ROUND([Landing CG] * 300),
      """ y2=""", ROUND(0 - [Landing weight]),
      """ stroke=""black"" stroke-width=""3"" vector-effect=""non-scaling-stroke"" stroke-dasharray=""2"" />",

      "<circle id=""landing-dot-blue"" cx=""", ROUND([Landing CG] * 300),
      """ cy=""", ROUND(0 - [Landing weight]),
      """ r=""80"" fill=""blue"" stroke=""white"" stroke-width=""2"" vector-effect=""non-scaling-stroke"" />"
    )
  ),

  "</svg>"
)

Now you might be thinking, “yeah, that’s great, but we know LLMs can write code, so why not just vibe code the whole app?” Three reasons:

  1. I wanted to minimize the amount of code, period. The last thing I want is for the non-profit organization (with or without me) to have to maintain a bunch of AI slop. Other than the SVG code shown, the only other code required is relatively straightforward spreadsheet formulas. AppSheet builds the UI from the data model itself so there is no UI code at all.
  2. I don’t want to set up and maintain new developer accounts with Apple and Google to publish the mobile apps. Instead, the users just download the existing AppSheet app from Google, allowing them to run this app and others I created for them.
  3. AppSheet automatically handles authentication from Google, Microsoft, and many others. I have zero interest in maintaining authentication code and keeping it up to date, even with AI.

In summary, I estimate I developed moderately complex AppSheet apps about 4x faster with Gemini than would have been possible otherwise. I had so much fun with AppSheet and Gemini that I created a personal productivity tool, as well, but I’ll save that for another blog post.

Posted in Uncategorized | Tagged: , | Leave a Comment »

Delta Airlines wins tonight

Posted by David Chandler on March 16, 2026

Tonight my Delta connecting flight from MSP to final destination Louisville (SDF) was cancelled due to crew shortage, presumably because of the snow storms and severe weather still hammering the East Coast. This has happened to me many times with other airlines. What is notable about the Delta experience is that

  1. The flight was officially cancelled a few minutes BEFORE the originally scheduled boarding time. This means I did not have to wait hours and hours into the night, hanging around the gate for updates in the event the flight might eventually go at 0 dark 30.
  2. Within 5 minutes of the cancellation text msg and notification in the Delta app, I was able to rebook a flight tomorrow morning at 8:50am (NOT 5:30am as often happens with other airlines). The whole rebooking experience was easy, albeit I had to try several times before I could get final confirmation.
  3. Within 15 minutes of the notice, I received a text message and email offering me a hotel and meal vouchers, all electronic and immediately confirmed.
  4. Within an hour, I was actually checked in to the nearby Doubletree Hotel and eating my complimentary warm cookie.

NEVER in all my years as a United Platinum flyer did United take care of me this way. This is all especially amazing since Delta’s Minneapolis hub was perhaps the hardest hit by all the weather yesterday and is still in recovery mode. Delta is almost always the most expensive fare to the places I want to fly, but after tonight, the discount airlines will have to be a LOT cheaper to make the discount worthwhile.

Posted in Travel | Leave a Comment »

How Churches Can Use Generative AI

Posted by David Chandler on January 28, 2026

My “Christian geek” readers will be especially interested in this interview with Rick Wilson of Entrusted Word Ministries. Rick, a former technology executive, has long been an early adopter of technology to help conservative evangelicals more effectively train people for ministry. As GenAI permeates every aspect of society, Rick has been helping Christian ministries significantly enhance their productivity using LLMs. In this video, we briefly explore Google’s NotebookLM for creating study guides and infographics as well as discuss using sophisticated GenAI models and prompts for language translation. We also cover some of the common philosophical objections to AI tools.

The video features a conversation between David Michael Chandler and a guest, Rick, discussing practical ways churches and ministries can utilize Generative AI.

Here is a summary of the main discussions:

1. Creating Ministry Resources with NotebookLM

Rick demonstrates how he uses Google’s NotebookLM to prepare teaching materials, specifically for a study on The Screwtape Letters. He highlights that the tool allows users to upload sources (like book chapters) and generate various aids:

  • Discussion Guides & Infographics: He shows how he generates discussion questions and creates infographics that summarize chapters. He notes the infographics are unique creations based on his specific prompts, not copies found on the internet [02:39].
  • Audio Overviews: He explains the “Audio Overview” feature, which automatically generates a podcast-style conversation summarizing the content [01:41].
  • Study Aids: The tool can also create quizzes, flashcards, slide decks, and mind maps to help students learn the material.

2. AI in Bible Translation

The discussion moves to how Large Language Models (LLMs) are particularly effective for translation because they have been trained on scripture in many languages.

  • Complex Translation Projects: Rick shares that he is assisting a group in Ukraine with translating original Masoretic Hebrew and Koine Greek into modern Ukrainian. He notes that this process involves a highly complex prompt—over 2,500 lines long—to ensure the AI produces a high-quality initial draft [07:02].

3. Personal Evangelism Example

David shares a personal story about using AI to witness to a cafe owner in Mexico.

  • Creating a Custom Tract: After learning the cafe was named “Shipwreck,” David used Gemini to write a short gospel presentation connecting the name to the biblical story of Jesus calming the storm [08:31].
  • Translation & Art: He used Google Docs to translate the text into Spanish and Gemini to generate an illustration, effectively creating a personalized tract to give to the owner the next day [09:44].

4. The Philosophy of Using AI for Ministry

The video concludes with a discussion on the ethics of AI.

  • Tool vs. Threat: Rick addresses the fear surrounding AI, admitting it can be used for laziness or cheating, but argues it should be viewed as a tool for “kingdom work” and edification [10:52].
  • The “Steak Knife” Analogy: He compares AI to a steak knife, which can be used properly to cut food or improperly to harm someone. He urges Christians to use the tool for its intended good purposes rather than avoiding it out of fear [12:28].
  • “Fill it with Gospel”: David references a quote by John Piper regarding the early internet, suggesting that if AI is a new channel, Christians should “fill it up with gospel” [13:12].

Posted in Christian geek | Tagged: , , , , | Leave a Comment »

Visualize population growth with BigQuery public data and GeoViz (FREE)

Posted by David Chandler on April 29, 2025

The query used for this video is available in the YouTube description.

  • The presenter starts with a query that joins population data from 2000 and 2010, comparing population change by zip code in Tennessee [00:13].
  • The query also pulls in latitude and longitude coordinates for each zip code from a BigQuery public data utility table [00:58].
  • The presenter then uses BigQuery Geo Viz to plot the data, showing population growth areas in red [01:29].
  • They add shading to the map to represent population growth on a light to dark scale, using fill opacity and linear interpolation [01:50].
  • The presenter explains that the shading is based on the population percentage change field, with lighter areas representing no growth and darker areas representing higher growth [02:13].
  • The video concludes by noting that BigQuery Geo Viz is a good choice for latitude and longitude-based visualizations and easy shading [03:19].

Posted in BigQuery | Tagged: | Leave a Comment »

How to import data from an API into BigQuery

Posted by David Chandler on April 28, 2025

This BigQuery import pattern makes it easy to import data from an API like the ClientTether CRM into BigQuery using python and pandas Dataframes. This video focuses on the BigQuery structures.

Posted in BigQuery | Leave a Comment »

How to create a filled map using Looker Studio with BigQuery

Posted by David Chandler on April 21, 2025

Create a map visualization using BigQuery and Looker Studio. See summary with timestamps below.

This video tutorial guides viewers through creating map visualizations in Looker Studio using data from Google BigQuery. The video emphasizes cost-effective strategies within the Google data platform.

Here’s a breakdown:

  • Data Source and Preparation: The video uses an EPA dataset on particulate matter (PM2.5) to demonstrate the process [00:20]. It highlights the importance of managing costs in BigQuery, especially with large datasets [00:55]. The tutorial focuses on extracting specific data points—sample measurement, timestamp, and state name—to create an effective map visualization [01:33].
  • Creating Visualizations in Looker Studio: The video details how to use Looker Studio to visualize data without coding [03:14]. It covers customizing charts, such as displaying the average sample measurement by state [03:54].
  • Map Creation: The tutorial explains how to create a field map chart to represent pollution levels by state [05:45]. It addresses common issues like invalid dimension errors by showing how to correctly set the geo type for state names [06:49]. The video also covers customizing the map’s color scheme to visually represent data ranges [08:36].
  • Adding Time-Based Controls: The video demonstrates adding a drop-down list to filter data by year, enhancing the map’s interactivity [10:14]. It explains how to ensure that the date range dimension is correctly set to allow filters to work properly [12:30].
  • Cross-Linking Components: The tutorial showcases Looker Studio’s ability to link different components, allowing users to interact with the map and see corresponding data updates in other charts [15:02]. For example, clicking on a state on the map updates a bar chart to show monthly trends for that state [17:33].
  • Optimizing BigQuery Costs: The video discusses strategies for minimizing BigQuery costs by selecting only necessary data fields [18:33]. It compares directly querying data versus creating a new table with extracted data for use in Looker Studio, recommending the latter for cost efficiency and data management [21:44].
  • Final Steps: The video concludes by reiterating the benefits of using pre-filtered data to reduce costs and improve performance in Looker Studio [23:34].

Posted in BigQuery, Google Cloud Platform, Looker Studio | Leave a Comment »

Spreadsheet = data warehouse?!

Posted by David Chandler on April 10, 2025

I’ve started a new YouTube channel to do screencasts and hopefully build my Google Cloud data consulting business, as well. For starters, here’s one of my favorite demos.

Posted in BigQuery, Google Cloud Platform, Google Sheets | Tagged: , , | Leave a Comment »

Debugging a Looker Studio report driven by a BigQuery FULL OUTER JOIN

Posted by David Chandler on February 18, 2025

I ran into an interesting gotcha recently while working on a marketing effectiveness report for a national franchise system. Their BigQuery data warehouse (for which they’ve still not paid a penny because the data is <10GB!) incorporates profit and loss data imported from QuickBooks CSV reports as well as marketing data pulled nightly from their ClientTether CRM. Now they want to be able to see, across their entire franchise system, the effectiveness of each marketing lead source by computing the cost per customer acquisition for each source.

The simplest way to start is with an INNER JOIN between the leads table (name pipeline) and the profit_loss table matched by spending Category (Facebook, Google, Angi Leads, etc.). However, an INNER JOIN excludes two types of leads sources of special interest:

  • Free leads from sources such as customer referrals. These exist in the pipeline table but there is no associated P&L spend.
  • Money spent on marketing which resulted in no customer leads.

To handle both these cases, we need a FULL OUTER JOIN between the pipeline table and the profit_loss table. The simplifed query looked something like this:

SELECT
  p.month_date,
  p.location,
  p.contact_lead_source,
  pl.Category,
  p.leads as opportunity_count,
  p.appts as estimates,
  pl.amt AS amt,
  p.quoted_revenue AS quoted_revenue,
  p.completed_revenue AS completed_revenue
FROM
  profit_loss_by_category pl
FULL JOIN 
  pipeline_monthly p
ON
  pl.location = p.location
  AND p.month_date = pl.month_date
  AND pl.Category = p.Category

A Looker Studio chart generated from this view should show the # of leads and total cost for each marketing category. However, it was omitting categories from the P&L table with no associated leads. At length, I asked Gemini in BigQuery for help by pasting in the query and asking for an explanation. I then further prompted it to explain why Categories were not being pulled in.

Gemini’s response is quite good, but it seemed incorrect as Looker Studio was still not showing the spending categories from the profit_loss table only. However, when debugging report interfaces, it’s always helpful to look at the raw data. So I ran the same query that Looker Studio is using directly in BigQuery and spotted the problem:

Many of the missing Categories did in fact show up in the query results, but with NULL values for the month_date and location (just as Gemini said). The FULL JOIN was working exactly as expected, but the Looker Studio report filters by both date and location, and therefore was excluding rows containing NULLs in these fields. Fortunately, this is easy to resolve by adding COALESCE for these fields to pull them from whichever side of the join is not NULL.

SELECT
  coalesce(p.month_date,pl.month_date) as month_date,
  coalesce(p.location,pl.location) as location,
  p.contact_lead_source,
  coalesce(p.Category,pl.Category) as Category,
  p.leads as opportunity_count,
  p.appts as estimates,
  pl.amt AS amt,
  p.quoted_revenue AS quoted_revenue,
  p.completed_revenue AS completed_revenue
FROM
  pl_by_category pl
FULL JOIN 
  pipeline_monthly p
ON
  pl.location = p.location
  AND p.month_date = pl.month_date
  AND pl.Category = p.Category

Following the simple addition of COALESCE, Looker now correctly includes marketing sources with marketing spend but no leads. The middle column is the number of leads that resulted in customer estimates and the final column the corresponding marketing spend. (In order to preserve privacy, the data shown below is for a subset of franchises and a short time period so some marketing sources generated no leads in that time period).

The Looker Studio report now correctly includes data from both sides of the join: Marketing categories with no leads as well as leads with no associated spend for a given month.

Takeaways

The following may help you whenever you’re building a report using an OUTER JOIN.

  • Look at the raw data sooner than later!
  • Make sure any fields needed by report filters are non-NULL.
  • To populate fields from either side of an OUTER join, use COALESCE.

Posted in BigQuery, Google Cloud Platform, Headsmack | Tagged: , , , | Leave a Comment »

How to compute total dataset size in BigQuery

Posted by David Chandler on October 4, 2023

BigQuery’s INFORMATION_SCHEMA views provide a ton of useful information about BQ usage. A simple query will let you see the total size of each table in a dataset and you can use the ROLLUP() operator to compute a grand total for the whole dataset:

SELECT
  table_id,
  -- Convert bytes to GB.
  sum(ROUND(size_bytes/pow(10,12),2)) as size_tb,
  sum(ROUND(row_count/pow(10,9),2)) as billion_rows
FROM
  -- Replace bigquery-public-data.wikipedia with your own dataset:
  `bigquery-public-data.wikipedia.__TABLES__`
WHERE table_id LIKE 'pageviews%'
GROUP BY ROLLUP(table_id)
ORDER BY table_id;

The query above shows the total size of all the pageviews tables in the wikipedia public dataset. At the time of this writing, these are the results. The first row is the grand total computed by the ROLLUP() function.

Querying all the pageviews tables with a wildcard operator would ingest 20TB and almost half a trillion rows! Be careful where you do that as it might cost you ~$100, but running the INFORMATION_SCHEMA query above is free as it only queries metadata.

Posted in BigQuery, Google Cloud Platform | Tagged: | Leave a Comment »

Estimating BigQuery slot usage for a query

Posted by David Chandler on October 3, 2023

One of the most common questions I’m asked when teaching Data Engineering on Google Cloud Platform is how to find out how many slots BigQuery used to run a query. While there is no direct measurement available on a per query basis, the INFORMATION_SCHEMA table documentation provides a way to estimate the number of slots used. You simply divide the total slot time, which is the time the query ran across all workers, by the elapsed time of the query. The query below will show the estimated number of slots for the 10 most recent queries. Alternatively, you can put a BigQuery job ID in the WHERE clause to see the data for a specific query. Obtain the job ID from the Job Information tab in the results or from a log entry in the Cloud Logs Explorer.

# Avg slots per query
# See https://cloud.google.com/bigquery/docs/information-schema-jobs#estimate_slot_usage_and_cost_for_queries
SELECT query, job_id, start_time,
-- Average slot utilization per job is calculated by dividing total_slot_ms by the millisecond duration of the job
SAFE_DIVIDE(job.total_slot_ms,(TIMESTAMP_DIFF(job.end_time, job.start_time, MILLISECOND))) AS job_avg_slots,
user_email,
ROUND(total_bytes_processed / POW(10,9), 2) AS gb_processed,
total_slot_ms, reservation_id
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT job
-- WHERE job_id = "your_job_id"
ORDER BY gb_processed DESC
LIMIT 10

Here are some sample results:

BigQuery results showing average slots per query

Note that the BigQuery Admin console as well as the Cloud Monitoring section of the cloud console will show the number of queries in flight and slot utilization across your entire organization. However, when you’re just dying to know how many slots an individual query probably used, the above query will do the trick.

Posted in BigQuery | Tagged: | Leave a Comment »