HomeAbout MeBook a Call

Build an AI Business Insights Dashboard with AppSheet and Looker Studio

By Vo Tu Duc
Published in AppSheet Solutions
May 05, 2026
Build an AI Business Insights Dashboard with AppSheet and Looker Studio

Collecting data is the starting line, not the finish. Learn how to transform your raw information from a simple database into an automated engine for strategic intelligence.

image 0

Introduction: Beyond Data Collection to Automated Intelligence

You’ve done the hard part. You’ve identified a business process, built a robust AI-Powered Invoice Processor application to streamline it, and successfully deployed it to your team. The data is flowing in—sales reports, inspection logs, customer feedback, inventory updates. Your Google Sheet or SQL database is filling up with valuable, structured information. This is a monumental achievement, a leap forward from paper forms and scattered spreadsheets. But let’s be honest: this is just the starting line.

Collecting data is not the end goal. The true power lies in transforming that raw data into a strategic asset—an engine for smarter decisions, predictive insights, and automated intelligence. The challenge is that the path from a raw data table to a C-suite-ready insight is often a manual, time-consuming, and reactive process. We’re here to change that. This guide is about building a system that doesn’t just store data, but understands it. We will architect an automated pipeline that funnels your AMA Patient Referral and Anesthesia Management System data through the analytical power of Google Cloud and the cognitive capabilities of generative AI, culminating in a dynamic Looker Studio dashboard that tells a story, reveals hidden trends, and empowers proactive decision-making.

The Challenge: From Raw AppSheetway Connect Suite Data to Actionable Insights

If you’re using OSD App Clinical Trial Management, you’re likely familiar with this scenario. You have an app capturing daily field service reports, complete with technician notes and customer satisfaction scores. The data is accurate and timely, but it exists as thousands of rows in a spreadsheet. To understand performance, you find yourself in a familiar loop:

  1. Manual Export & Cleanup: You download the data, clean up inconsistencies, and try to standardize the free-text notes.

  2. Spreadsheet Gymnastics: You wrestle with pivot tables, VLOOKUPs, and complex formulas to aggregate numbers and spot anomalies.

  3. Subjective Analysis: You manually read through hundreds of technician notes or customer comments, trying to get a “feel” for sentiment or recurring issues.

  4. Static Reporting: You painstakingly build charts in Sheets or Slides, creating a static snapshot in time that is obsolete the moment it’s published.

This “manual reporting treadmill” is not only inefficient but also fundamentally limited.

image 1

The Solution: An AI-Powered Architecture for Business Intelligence

To break free from the manual treadmill, we need a new architecture—one that automates the entire journey from data capture to insight delivery. Our solution is a cohesive, cloud-native pipeline that treats your AppSheet data as a live stream of intelligence waiting to be unlocked.

Here’s the high-level blueprint of what we will construct:

  1. Data Capture (AppSheet): Your existing, user-friendly mobile and web apps continue to serve as the primary interface for data entry. This is our system’s edge—where business reality is digitized.

  2. Data Warehousing (BigQuery): Instead of a simple spreadsheet, we will pipe the data into BigQuery, Google’s serverless, highly scalable data warehouse. This becomes our single source of truth, capable of handling massive datasets and performing complex queries in seconds.

  3. AI Enrichment (Cloud Functions & Building Self Correcting Agentic Workflows with Vertex AI): This is the core of our intelligent system. We’ll use a Cloud Function—a small piece of serverless code—that automatically triggers whenever new data arrives in BigQuery. This function will send unstructured data (like customer feedback) to a powerful generative AI model like Google’s Gemini. The model will analyze the text and return structured insights, such as sentiment score (Positive, Neutral, Negative), issue categorization (e.g., “Billing,” “Technical,” “Logistics”), and even a concise summary. This enriched data is then written back into BigQuery.

  4. Visualization & Exploration (Looker Studio): Finally, we connect Looker Studio to our enriched BigQuery table. This is where the magic becomes visible. We will build an interactive dashboard that allows stakeholders to not only see the raw numbers but also filter by AI-generated sentiment, explore trends by issue category, and drill down into the underlying data with a few clicks.

This architecture transforms your workflow from a manual, periodic task into a real-time, automated intelligence engine.

What You’ll Learn: A Step-by-Step Architectural Guide

This article is your hands-on guide to building this entire system from the ground up. We will move beyond theory and dive into the practical steps, providing the code, configurations, and strategic advice you need to succeed. By the end of this tutorial, you will have mastered the following:

  • Setting Up the Foundation: How to configure a BigQuery table as a scalable and robust backend for your AppSheet application.

  • Automating the Data Pipeline: How to use AppSheet webhooks or [AI Powered Cover Letter [Automated Job Creation in Real Time Jobber and Google Sheets Integration from Gmail](https://votuduc.com/Automated-Job-Creation-in-Jobber-from-Gmail-p115606) Engine](https://votuduc.com/AI-Powered-Cover-Letter-Automated Quote Generation and Delivery System for Jobber-Engine-p111092) to automatically send new and updated records from your app directly to BigQuery.

  • Building the Intelligence Layer: How to write and deploy a Google Cloud Function that listens for new data, calls the Vertex AI Gemini API for text analysis and enrichment, and updates your BigQuery records.

  • Crafting the Insight Dashboard: How to connect Looker Studio to your AI-enriched BigQuery data source and build a powerful, interactive dashboard that visualizes sentiment trends, issue categories, and key performance indicators.

  • Closing the Loop: We’ll explore advanced concepts for creating a feedback loop where insights generated by the AI can be surfaced back within the AppSheet app itself, empowering your frontline users with real-time intelligence.

Get ready to elevate your AppSheet solution from a simple data collection tool to a sophisticated, AI-driven business insights platform. Let’s start building.

The High-Level Architecture: Connecting the Dots

Before we start laying down code and configuring services, let’s zoom out and look at the blueprint for our solution. Understanding the high-level architecture is crucial. It’s the map that shows how disparate services on Google Cloud and AppSheet come together to form a cohesive, intelligent system. Think of it as a relay race for your data: each component takes the baton, adds value, and passes it to the next, transforming a simple user note into a powerful business insight on a dashboard.

Component Roles: AppSheet, BigQuery, Vertex AI, and Looker Studio

Our architecture is built on four key pillars, each with a distinct and vital role.

  • AppSheet: The Data Capture Front-End

AppSheet serves as our user-facing interface. It’s the no-code platform we’ll use to build a simple, elegant mobile and web application. For our use case, this app will be the primary tool for employees—sales reps, field technicians, customer support agents—to quickly capture qualitative data in a structured way. Its role is to be the easy, accessible entry point for raw information from the front lines of your business.

  • BigQuery: The Scalable Data Warehouse

BigQuery is the central nervous system of our operation. It’s a serverless, highly scalable, and cost-effective data warehouse where all data captured by AppSheet will be stored. In our project, BigQuery will house two key tables: one for the raw, unprocessed text data coming directly from AppSheet, and a second, “enriched” table that will store the structured insights generated by our AI model. It acts as the single source of truth for both raw input and intelligent output.

  • Vertex AI: The Intelligence Engine

This is where the magic happens. Vertex AI is Google Cloud’s unified AI platform. We will leverage its powerful Generative AI models (like Gemini) to act as our “brains.” Its role is to programmatically read the raw text data stored in BigQuery, understand the context, and perform sophisticated Natural Language Processing (NLP) tasks. This includes How to build a Custom Sentiment Analysis System for Operations Feedback Using Google Forms AppSheet and Vertex AI, topic categorization, entity extraction, and generating concise summaries. It transforms unstructured text into structured, analyzable data points.

  • Looker Studio: The Visualization & Insights Hub

Looker Studio (formerly Google Data Studio) is the final piece of the puzzle. It’s our business intelligence and visualization tool. Its job is to connect directly to the AI-enriched data in BigQuery and present it through interactive charts, graphs, and tables. This is the command center where business leaders and analysts can explore trends, filter by sentiment or category, and derive actionable insights from the data without ever having to look at a raw database table.

The End-to-End Data Flow: From User Input to AI-Generated Insight

Now, let’s trace the journey of a single piece of data as it flows through our system. This step-by-step process illustrates how the components work in concert.

  1. Capture: A sales representative finishes a client meeting and opens the AppSheet app on their phone. They enter a note: “Client was very happy with the new feature proposal but raised concerns about the Q4 pricing model. They mentioned competitor XYZ’s recent discount.” They hit ‘Save’.

  2. Ingestion: AppSheet automatically and instantly syncs this new record to our raw_feedback table in Google BigQuery. The table now has a new row containing the text, timestamp, user ID, and other metadata.

  3. AI Trigger & Processing: The insertion of a new row in BigQuery triggers an event. We’ll configure a BigQuery remote function that calls a Cloud Function. This Cloud Function securely packages the raw text from the new row and sends it to the Vertex AI API.

  4. Enrichment: The Vertex AI model analyzes the text. It determines:

  • Sentiment: Positive

  • Topics: “Feature Proposal”, “Pricing Concern”, “Competitor Mention”

  • Entities: “XYZ” (Competitor)

  • Summary: “Client pleased with feature, but concerned about Q4 pricing and competitor discounts.”

  1. Store Insights: The Cloud Function receives this structured JSON output from Vertex AI and writes it into our second BigQuery table, enriched_insights. This new row is linked back to the original entry in the raw_feedback table.

  2. Visualize: The Looker Studio dashboard, which is connected live to the enriched_insights table, automatically updates. The “Sentiment Trend” chart ticks up, a new entry appears in the “Pricing Concerns” table, and the “Competitor Mentions” word cloud grows. A manager can now see this new insight in near real-time, aggregated with all other feedback.

Prerequisites and Setup Overview

Before you roll up your sleeves and start building, you’ll need to have a few things in place. The rest of this guide will walk you through the detailed steps, but here is a checklist of what you need to get started:

  • A Google Cloud Platform (GCP) Account: If you don’t have one, you can sign up for a free trial, which typically includes generous credits to build this entire project.

  • A GCP Project: Create a new, dedicated project within your GCP account to keep all the resources for this dashboard organized.

  • Billing Enabled: You must have billing enabled on your GCP project to use the APIs. Be sure to set up budget alerts to monitor your costs.

  • Required APIs Enabled: In your new GCP project, you will need to search for and enable the following APIs:

  • BigQuery API

  • Vertex AI API

  • Cloud Functions API

  • Cloud Build API (often a dependency for Cloud Functions)

  • An AppSheet Account: You can sign up with your Google account for seamless integration.

  • Looker Studio Access: This is a free tool available with your Google account.

Step 1: Structuring and Capturing Data in AppSheet

Before we can visualize anything in Looker Studio or apply AI with BigQuery, we need a robust and reliable way to capture data. This is where AppSheet shines. It acts as our user-friendly front-end, the “tip of the spear” for data entry. However, the principle of “garbage in, garbage out” is critically important here. The structure of our AppSheet application and the integrity constraints we build into it will directly determine the quality and usefulness of our final dashboard. Let’s lay a solid foundation.

Designing a Data Model Optimized for Analysis

An AppSheet app built for simple task tracking might have a very different data structure than one designed to feed an analytical dashboard. For analysis, we need to think like a data architect, creating a model that’s not just functional for the app user but also logical for the analyst. This often means designing a simple star schema, with a central “fact” table surrounded by descriptive “dimension” tables.

Let’s consider a practical example: a field sales reporting app. Our goal is to capture sales transactions and customer feedback.

A well-structured model for this scenario in AppSheet would consist of several related tables:

  • Sales_Transactions (The Fact Table): This is the heart of our model. It records events. Each row is a unique sales transaction.

  • TransactionID: The key column (using UNIQUEID()).

  • Timestamp: A DateTime column to record when the sale occurred.

  • SaleAmount: A Price column.

  • UnitsSold: A Number column.

  • ProductID: A Ref column that points to the Products table.

  • CustomerID: A Ref column that points to the Customers table.

  • SalesRepEmail: An Email column, pre-filled with USEREMAIL().

  • Products (A Dimension Table): This table provides descriptive context for the products sold.

  • ProductID: The key column.

  • ProductName: A Text column.

  • Category: An Enum column (e.g., “Hardware”, “Software”, “Services”).

  • Cost: A Price column.

  • Customers (A Dimension Table): This table provides context about the customers.

  • CustomerID: The key column.

  • CustomerName: A Text column.

  • Region: An Enum column (e.g., “North”, “South”, “West”).

  • Tier: An Enum column (e.g., “Gold”, “Silver”, “Bronze”).

Using Ref columns is the AppSheet equivalent of creating foreign key relationships in a traditional database. This is non-negotiable for good data modeling. It ensures that a Sales_Transaction can only be logged against a valid, existing ProductID and CustomerID, preventing orphaned records and maintaining relational integrity from the point of capture.

Configuring AppSheet Automated Work Order Processing for UPS to Write Data to BigQuery

With our data model in place, we need to create the pipeline that moves data from our app’s backend (like a Google Sheet) to our analytical warehouse, BigQuery. We’ll use Architecting Autonomous Data Entry Apps with AppSheet and Vertex AI for this. This process creates a robust, event-driven mechanism to push new data in near real-time.

Here’s the step-by-step process to configure the automation:

  1. Navigate to the Automation Tab: In the AppSheet editor, click on the Automation icon in the left-hand navigation pane.

  2. Create a New Bot: Click + New Bot. Give it a descriptive name, such as On New Sale, Sync to BigQuery.

  3. Configure the Event (The “When”): This is the trigger for our automation.

  • Click Configure event and then Create a custom event.

  • Event Name: New Sales Transaction.

  • Event Type: Data Change.

  • Table: Select your fact table, Sales_Transactions.

  • Data-Change Type: Select Adds only. For analytical workloads, you typically want an immutable, append-only log of transactions. This is the cleanest approach.

  1. Configure the Process and Task (The “Do This”): This is the action that will be performed when the event fires.
  • In your bot’s flow, click Add a step and then Create a custom step.

  • Step Name: Push Row to BigQuery.

  • Under Run this task:, choose Call a webhook.

  1. Set Up the BigQuery Task:
  • Task Type: Choose Call a webhook.

  • Preset: This is the key. Click the dropdown and select Google BigQuery - Insert Rows. AppSheet has a native integration that simplifies this immensely.

  • Table Name: Enter the full path to your target BigQuery table. You must create this table in BigQuery first. The format is your-gcp-project-id.your_dataset_name.your_table_name.

  • **Body: This is where you map your AppSheet columns to your BigQuery table fields. AppSheet provides a default template. You need to ensure the keys in the JSON object match your BigQuery column names exactly, and the values use AppSheet’s expression syntax <<[ColumnName]>> to pull in the data from the newly added row.

A sample Body would look like this:


{

"rows": [

{

"json": {

"transaction_id": "<<[TransactionID]>>",

"event_timestamp": "<<[Timestamp]>>",

"product_id": "<<[ProductID]>>",

"customer_id": "<<[CustomerID]>>",

"sale_amount": "<<[SaleAmount]>>",

"units_sold": "<<[UnitsSold]>>",

"sales_rep_email": "<<[SalesRepEmail]>>"

}

}

]

}

Crucial Note: The column names in the JSON (transaction_id, event_timestamp, etc.) must perfectly match the column names in your BigQuery table schema. The data types must also be compatible (e.g., AppSheet DateTime maps to BigQuery TIMESTAMP).

Once configured, save your bot. Now, every time a new sales transaction is saved in the AppSheet app, this automation will fire and insert a new row into your BigQuery table within seconds.

Best Practices for Ensuring Data Integrity at the Source

A clean data pipeline is useless if the source data is flawed. AppSheet provides powerful tools to enforce business rules and ensure high-quality data capture directly within the app, long before it ever reaches BigQuery.

  • Use Valid_If Constraints: This is your most powerful tool for data validation. It’s an expression that must evaluate to TRUE for the data to be considered valid.

  • Example 1 (Range Check): In the Sales_Transactions table, for the UnitsSold column, a Valid_If constraint of [UnitsSold] > 0 prevents users from entering zero or negative quantities.

  • Example 2 (Dependent Dropdowns): If you had a SubCategory column in your Products table, you could create a dropdown that only shows sub-categories relevant to the already selected Category. The Valid_If expression would be something like: SELECT(Products[SubCategory], [Category] = [_THISROW].[Category]).

  • Leverage Required, Editable_If, and Initial Value:

  • Required: Mark essential fields like ProductID and CustomerID as required to prevent incomplete records.

  • Editable_If: Prevent users from changing critical data after it has been created. For example, setting the Editable_If expression for the TransactionID column to FALSE makes it a write-once field.

  • Initial Value: Reduce user effort and standardize data by setting initial values. For the Timestamp column, an initial value of NOW() automatically records the current time. For SalesRepEmail, USEREMAIL() automatically captures the logged-in user’s email.

  • Implement User Roles and Security Filters: Not all users should see or edit all data. Security filters are expressions that filter the data a user can interact with based on their identity.

  • Example: A security filter on the Sales_Transactions table like [SalesRepEmail] = USEREMAIL() would ensure that sales reps can only see their own transactions, preventing them from accidentally viewing or editing a colleague’s data. A manager could have a different role without this filter.

By meticulously designing your data model, automating the data flow, and rigorously enforcing integrity at the point of capture, you create a trustworthy data foundation. This initial effort in AppSheet pays massive dividends downstream, enabling faster, more accurate, and more insightful analysis in BigQuery and Looker Studio.

Step 2: Warehousing and Preparing Data with BigQuery

With our AppSheet application diligently collecting data, the raw entries are now flowing directly into a BigQuery table. This is a massive first step, but raw data is like unrefined ore—the potential is there, but it’s not yet ready for the forge of an AI model. BigQuery is our industrial-grade refinery. Here, we’ll transform that raw data into a clean, structured, and reliable fuel source for our machine learning pipeline.

This process involves three critical stages: first, we’ll validate the data’s structure to ensure it’s compatible with our models. Second, we’ll create a simplified “view” to act as a clean interface for the AI. Finally, we’ll set up an automated trigger to process new data as it arrives, ensuring our insights are always fresh.

Validating the Table Schema for AI Processing

The old adage “garbage in, garbage out” is the cardinal rule of machine learning. An AI model is incredibly sensitive to the format, type, and quality of its input data. The schema automatically created by AppSheet is a great starting point, but it’s crucial to verify it’s optimized for analytical processing.

What to look for:

  1. Correct Data Types: Did BigQuery correctly infer that a column of numbers is a NUMERIC or INT64, not a STRING? Are timestamps properly recognized as TIMESTAMP? Mismatched data types are a common source of errors and inaccurate model behavior.

  2. Nullability: Are essential columns—like a customer_id or transaction_amount—allowed to be NULL? A model may not know how to interpret a missing value, potentially skewing results. We need to enforce NOT NULL constraints or have a clear strategy for handling these gaps.

  3. Consistency: While not strictly a schema issue, this is the perfect time to check for inconsistencies. For example, a categorical status column might contain “Complete”, “complete”, and “completed”. These need to be standardized.

How to Validate in BigQuery:

First, you can visually inspect the schema in the BigQuery UI by selecting your table and clicking the Schema tab. For a more programmatic approach, you can run simple queries.

To check for unexpected NULL values in a critical column:


-- Count how many rows have a NULL value in the 'product_id' column

SELECT

COUNTIF(product_id IS NULL) AS null_product_ids,

COUNT(*) AS total_rows

FROM

`your-project.your_dataset.raw_appsheet_data`;

If you discover issues, the best practice is to fix them at the source in your AppSheet app’s column definitions. However, if that’s not feasible, you can create a new, cleaned table in BigQuery using a CREATE TABLE AS SELECT statement, using CAST to correct data types and COALESCE to handle nulls.

Creating Views to Simplify Data for the AI Model

Directly pointing your AI model to a raw, transactional table is a bad practice. The raw table might have dozens of columns, complex naming conventions, and inconsistent data. Instead, we’ll create a BigQuery View. A View is a saved query that acts like a virtual table, providing a clean, stable, and secure abstraction layer between your raw data and your AI model.

Why use a View?

  • Abstraction & Simplification: Hide the messy reality of your raw table. The View presents only the columns the model needs, with clear names and correct data types.

  • Feature Engineering: This is where the magic happens. A View is the perfect place to perform initial transformations and create new features (e.g., extracting the day of the week from a timestamp, calculating profit margin, or cleaning text fields).

  • **Security: You can grant the AI model’s service account access to only the View, preventing it from accessing sensitive columns (like PII) in the base table.

  • Maintainability: If you need to change the logic for cleaning a field, you can update the View’s SQL query without breaking the downstream model, which still queries the same View name.

Example: Creating a View for Sales Prediction

Let’s assume our AppSheet app collects sales records. We can create a view that prepares this data for a forecasting model.


CREATE OR REPLACE VIEW `your-project.your_dataset.vw_sales_for_ai`

OPTIONS(

description="A cleaned and feature-engineered view of sales data for ML model training and prediction."

) AS

SELECT

-- Select and cast key identifiers

CAST(transaction_id AS STRING) AS transaction_id,

CAST(customer_id AS STRING) AS customer_id,

-- Clean and standardize a categorical feature

TRIM(LOWER(product_category)) AS product_category,

-- Engineer time-based features from the transaction timestamp

CAST(transaction_timestamp AS TIMESTAMP) AS transaction_time,

EXTRACT(DAYOFWEEK FROM transaction_timestamp) AS day_of_week, -- 1 (Sun) to 7 (Sat)

EXTRACT(HOUR FROM transaction_timestamp) AS hour_of_day,

-- Ensure numeric features are the correct type and handle potential nulls

COALESCE(CAST(quantity AS INT64), 0) AS quantity_sold,

-- This is the target variable (label) we want to predict or analyze

(COALESCE(CAST(quantity AS INT64), 0) * COALESCE(CAST(unit_price AS NUMERIC), 0.0)) AS total_sale_amount

FROM

`your-project.your_dataset.raw_appsheet_data`

WHERE

-- Filter out potential test records or invalid entries

is_test_record IS FALSE

AND transaction_id IS NOT NULL;

Now, any AI process can simply SELECT * FROM your-project.your_dataset.vw_sales_for_ai to get perfectly prepared data every time.

Setting Up Triggers for New Data Events

Our dashboard needs to reflect the latest insights. Manually re-running the AI model every time a new piece of data comes from AppSheet is inefficient and unsustainable. We need to automate the pipeline. The goal is simple: when a new row is inserted into our raw BigQuery table, trigger the AI prediction process automatically.

The most robust way to achieve this in Google Cloud is by combining Cloud Audit Logs, Eventarc, and Cloud Functions.

Here’s the workflow:

  1. Data Insertion: A user submits data via AppSheet. AppSheet inserts a new row into the raw BigQuery table.

  2. Log Entry: This insertion action generates an audit log entry in Cloud Logging.

  3. Eventarc Trigger: We’ll configure an Eventarc trigger to specifically listen for these BigQuery insertion log entries.

  4. Cloud Function Execution: When the trigger fires, it invokes a Cloud Function—a small, serverless piece of code.

  5. AI Pipeline: The Cloud Function’s code is responsible for kicking off the next step, such as calling a BigQuery ML model to make a new prediction or starting a more complex Vertex AI pipeline.

Setting it up (High-Level Steps):

  1. Write a Cloud Function: You’ll write a simple function (e.g., in JSON-to-Video Automated Rendering Engine or Node.js) that contains the logic to run your prediction. This could be a SQL query that calls ML.PREDICT.

Conceptual Python Cloud Function:


# main.py

from google.cloud import bigquery

def run_bqml_prediction(event, context):

"""

Triggered by Eventarc on a BigQuery insert.

Refreshes the predictions table using a BQML model.

"""

client = bigquery.Client()

project_id = "your-project"

dataset_id = "your_dataset"

print(f"Processing event for BigQuery table insert: {event['resource']['name']}")

# This query re-runs prediction on the entire prepared view and overwrites the results table.

# For very large datasets, you might optimize this to predict only on new rows.

query = f"""

CREATE OR REPLACE TABLE `{project_id}.{dataset_id}.predicted_insights` AS

SELECT * FROM ML.PREDICT(MODEL `{project_id}.{dataset_id}.your_ai_model`,

(SELECT * FROM `{project_id}.{dataset_id}.vw_sales_for_ai`));

"""

query_job = client.query(query)

query_job.result()  # Wait for the job to finish

print("Prediction table has been successfully updated.")

  1. Create the Eventarc Trigger: In the Google Cloud Console or using the gcloud CLI, you’ll create a new trigger with the following configuration:
  • Trigger type: Google Cloud sources

  • Event provider: Cloud Audit Logs

  • Service: BigQuery API

  • Method: google.cloud.bigquery.v2.JobService.InsertJob (This is the specific API call for data insertion jobs).

  • Resource: The name of your raw AppSheet BigQuery table.

  • Destination: The Cloud Function you created above.

Once deployed, this serverless architecture will ensure that every new piece of data from your AppSheet app automatically triggers your AI pipeline, keeping your Looker Studio dashboard populated with near real-time insights without any manual intervention.

Step 3: Generating Insights with Vertex AI

With our data pipeline established and sales data flowing reliably into BigQuery, we’ve reached the most exciting part of our project: transforming raw numbers into narrative intelligence. This is where we move beyond simple aggregation and ask a generative AI to act as our virtual business analyst. We’ll use Google’s Vertex AI platform to analyze our data, identify meaningful patterns, and generate the concise summaries that will power our dashboard.

Choosing the Right Vertex AI Model for Trend Analysis

The first question is: which tool in the vast Vertex AI toolbox is right for the job? We’re not building a model from scratch; we’re leveraging the power of a pre-trained Large Language Model (LLM) to perform a sophisticated reasoning task. Our goal is to feed the model a chunk of our sales data and have it return a human-readable analysis of trends and anomalies.

For this task, our model of choice is Gemini 1.5 Pro. Here’s why it’s a perfect fit:

  • Massive Context Window: Gemini 1.5 Pro boasts a huge context window (up to 1 million tokens). Think of the context window as the model’s short-term memory. A larger window means we can feed it more data in a single request—for instance, an entire month’s worth of daily sales data—without truncation. This allows the model to see the bigger picture and identify trends over longer periods, just as a human analyst would review an entire report, not just a single line item.

  • Advanced Reasoning Capabilities: This isn’t just about finding the highest and lowest values. We need the model to understand seasonality, identify multi-day trends (e.g., “sales consistently grew in the third week”), and spot anomalies that aren’t just statistical outliers but are contextually significant. Gemini’s sophisticated reasoning is tailor-made for this kind of nuanced analysis.

  • Structured Output: Modern LLMs are exceptionally good at following formatting instructions. We can instruct Gemini to return its findings in a specific format, like JSON. This is a crucial feature that makes the AI’s output predictable and easy for our downstream processes to parse and store.

To guide the model, we’ll craft a precise prompt. [Prompt Engineering for Reliable Autonomous Workspace Agents for Reliable Autonomous Workspace Agents](https://votuduc.com/prompt-engineering-for-reliable-autonomous-workspace-agents-p-20260319404106) is the art and science of asking the AI the right question to get the right answer. Here’s a template for the prompt we’ll use:


You are an expert business analyst for a retail company. Your task is to analyze the following daily sales data and provide a concise, insightful report.

Here is the sales data for the last 30 days in CSV format:

<DATA_PLACEHOLDER>

Analyze this data and perform the following actions:

1.  **Executive Summary:** Write a brief, high-level summary (2-3 sentences) of the overall sales performance during this period.

2.  **Key Trends:** Identify 2-3 significant positive or negative trends. For each trend, describe it clearly (e.g., "Consistent weekend sales uplift," "Mid-week slump in the second half of the month").

3.  **Notable Anomalies:** Pinpoint any specific days with unusually high or low sales that deviate from the general trends. Provide a possible reason if the data suggests one.

Format your entire response as a single, valid JSON object with the following keys: "summary", "trends", and "anomalies". The value for "trends" and "anomalies" should be an array of strings.

By defining a role, providing clear context, and demanding a specific JSON output, we’re not just hoping for a good response; we’re engineering it. This structured approach is the key to building a reliable AI-powered pipeline.

Orchestrating the Analysis Pipeline with Cloud Functions

Manually running this analysis in the Vertex AI Studio is great for testing, but it doesn’t scale. We need an automated, serverless way to execute this workflow on a schedule. This is the perfect job for Cloud Functions, Google Cloud’s event-driven, serverless compute platform.

Our orchestration pipeline will look like this:

  1. Trigger: A Cloud Scheduler job is configured to run once every 24 hours (e.g., at 2 AM), triggering our Cloud Function.

  2. Fetch Data: The Cloud Function wakes up and connects to BigQuery. It executes a SQL query to pull the last 30 days of sales data from our sales_data table.

  3. Prepare the Prompt: The function takes the query results (a list of dates and sales figures) and formats them into a simple CSV string. It then injects this string into our prompt template, replacing the <DATA_PLACEHOLDER>.

  4. Invoke Vertex AI: Using the Vertex AI SDK for Python, the function sends the complete prompt to the Gemini 1.5 Pro model API.

  5. Process the Response: The function waits for the AI to process the request and send back the analysis in the JSON format we requested.

Here is a conceptual Python snippet illustrating how this would look inside a 2nd Gen Cloud Function:


import json

import vertexai

from vertexai.generative_models import GenerativeModel

from google.cloud import bigquery

# Initialize clients

PROJECT_ID = "your-gcp-project-id"

LOCATION = "us-central1"

vertexai.init(project=PROJECT_ID, location=LOCATION)

bigquery_client = bigquery.Client()

def run_ai_analysis(event, context):

"""

Cloud Function triggered by Cloud Scheduler to run daily sales analysis.

"""

# 1. Fetch data from BigQuery

query = """

SELECT sale_date, total_sales

FROM `your-dataset.sales_data`

WHERE sale_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)

ORDER BY sale_date

"""

query_job = bigquery_client.query(query)

rows = query_job.result()

# 2. Format data for the prompt

sales_csv_string = "date,sales\\n"

for row in rows:

sales_csv_string += f"{row.sale_date},{row.total_sales}\\n"

# 3. Prepare the full prompt

prompt_template = f"""

You are an expert business analyst...

Here is the sales data for the last 30 days in CSV format:

{sales_csv_string}

...Format your entire response as a single, valid JSON object...

"""

# 4. Invoke Vertex AI Gemini model

model = GenerativeModel("gemini-1.5-pro-001")

response = model.generate_content(prompt_template)

# The next step is parsing and storing this response...

ai_response_text = response.text

print(f"Received AI response: {ai_response_text}")

# ...to be continued in the next section.

return "Analysis complete.", 200

This serverless function acts as the intelligent glue, connecting our data warehouse (BigQuery) with our AI brain (Vertex AI) without requiring us to manage a single server.

Parsing AI Responses and Storing Insights in a New BigQuery Table

The final piece of the automation puzzle is to capture the generated insight and store it in a structured format that Looker Studio can easily consume. Simply logging the AI’s response isn’t enough; we need to persist it in its own BigQuery table.

This creates a clear separation between raw transactional data and derived AI insights. It also provides a historical record of the AI’s analysis over time, which can be valuable in its own right.

We’ll create a new table in BigQuery named ai_generated_insights with a schema like this:

| Field Name | Type | Description |

| ---------------------- | --------- | ----------------------------------------------------------- |

| insight_id | STRING | A unique identifier for each generated insight (e.g., UUID).|

| generation_timestamp | TIMESTAMP | When the insight was created. |

| summary | STRING | The executive summary from the AI. |

| trends | STRING | A JSON string array of identified trends. |

| anomalies | STRING | A JSON string array of identified anomalies. |

| source_period_start | DATE | The start date of the data used for this analysis. |

| source_period_end | DATE | The end date of the data used for this analysis. |

Now, we’ll extend our Cloud Function to perform the final steps:

  1. Parse the AI Response: Take the raw text response from Gemini. Because we instructed it to use JSON, we can parse this string directly into a Python dictionary. We should also include error handling in case the model occasionally fails to return perfect JSON.

  2. Prepare the Record: Construct a new row to be inserted into BigQuery, mapping the parsed data to the columns of our ai_generated_insights table.

  3. Insert into BigQuery: Use the BigQuery client library to stream the new record into the table.

Here’s the continuation of our Cloud Function code, showing these final steps:


# ... (previous code for fetching data and calling Vertex AI) ...

def run_ai_analysis(event, context):

# ... (code from previous section) ...

ai_response_text = response.text

# 5. Parse the AI's JSON response and store it in BigQuery

try:

insights = json.loads(ai_response_text)

table_id = "your-dataset.ai_generated_insights"

# Prepare the row to insert

# You would add logic to generate a UUID and get date ranges

row_to_insert = [{

"insight_id": "some-unique-id",

"generation_timestamp": "2023-10-27T12:00:00Z",

"summary": insights.get("summary"),

"trends": json.dumps(insights.get("trends", [])), # Store array as JSON string

"anomalies": json.dumps(insights.get("anomalies", [])),

"source_period_start": "2023-09-27",

"source_period_end": "2023-10-26"

}]

errors = bigquery_client.insert_rows_json(table_id, row_to_insert)

if errors == []:

print("New insight successfully added to BigQuery.")

else:

print(f"Encountered errors while inserting rows: {errors}")

except json.JSONDecodeError:

print("Error: Failed to decode AI response as JSON.")

return "Analysis and storage complete.", 200

With this final step, our automated pipeline is complete. Every day, the system will automatically query the latest sales data, ask Gemini to perform a sophisticated analysis, and store the structured results in a clean, dashboard-ready BigQuery table. We have successfully built an engine that turns data into intelligence, setting the stage for a truly dynamic and insightful visualization in Looker Studio.

Step 4: Visualizing AI-Powered Insights in Looker Studio

With our AI-enriched data pipeline now humming along in BigQuery, it’s time for the payoff. This is where we transform our structured, intelligent data into a dynamic, interactive dashboard. We’re moving beyond static reports and building an analytical tool that allows stakeholders to converse with the data, guided by the insights generated by our AI model. Looker Studio (formerly Google Data Studio) is the perfect canvas for this, offering a powerful, free-to-use platform to bring our vision to life.

Connecting Looker Studio to the AI-Enriched BigQuery Table

First things first, we need to bridge the gap between our data warehouse and our visualization tool. The native BigQuery connector in Looker Studio makes this a seamless process.

  1. Create a New Data Source: Navigate to the Looker Studio homepage and create a new report. You’ll immediately be prompted to connect to data. Select the BigQuery connector from the list of Google Connectors.

  2. Authorize and Select Your Table: You’ll be asked to authorize Looker Studio to access your Google Cloud project. Once authorized, you can navigate to your data using a three-tiered selection process:

  • Project: Select the Google Cloud Project where your BigQuery instance resides.

  • Dataset: Choose the dataset you created earlier (e.g., appsheet_feedback).

  • Table: Select the table containing the AI-enriched data (e.g., customer_feedback_enriched).

  1. Configure the Data Source: After selecting your table, click Add. Looker Studio will present you with the data source configuration screen. This is a critical checkpoint.
  • Verify Data Types: Looker Studio does a good job of inferring data types, but it’s best to double-check. Ensure your sentiment_score is a Number, feedback_date is a Date, and your AI-generated fields like sentiment, category, and summary are Text. Correcting these now prevents headaches later.

  • Create Calculated Fields (Optional): You can create new fields directly in the data source. For instance, you could create a Feedback Length field using the LENGTH() function on the feedback_text column if you wanted to analyze verbosity.

  • Check Data Freshness: By default, Looker Studio will cache your data to improve performance and control costs. You can adjust the “Data freshness” settings in the data source to define how often it queries BigQuery for new data, ranging from every 15 minutes to every 12 hours.

Once configured, your data source is ready. Every chart and control you add to your report will now pull directly from this live, AI-powered dataset.

Our goal isn’t just to plot data; it’s to build an “agentic” dashboard—one that actively surfaces insights and guides the user toward what’s important. We’ll design a layout that moves from a high-level overview down to the granular details.

1. The “At-a-Glance” KPI Header:

Start with a series of Scorecard charts at the top. These provide the most critical, top-line metrics for a quick health check.

  • Total Feedback Submissions: A simple COUNT() of all records.

  • Average Sentiment Score: An AVG() of the sentiment_score field. You can use conditional formatting to color it red, yellow, or green based on the value.

  • Most Common Category: A COUNT_DISTINCT() on the category field to show the breadth of topics, or a simple table showing the top category by count.

2. Visualizing Sentiment and Categories:

Next, use charts to break down the composition of the feedback.

  • Sentiment Over Time: A Time series chart is perfect here. Use your feedback_date as the dimension and AVG(sentiment_score) as the metric. This immediately reveals trends, such as a dip in sentiment after a product update or an improvement following a customer service initiative.

  • Sentiment Distribution: A Pie or Donut chart provides a clear, immediate breakdown of the sentiment field (Positive, Negative, Neutral). This answers the question: “What is the overall mood of our users?”

  • Feedback by Category: A Bar chart is ideal for visualizing the volume of feedback per AI-generated category. This instantly highlights the most talked-about topics (e.g., “Feature Requests,” “UI/UX Issues,” “Billing Problems”), telling your team where to focus their attention.

3. Bridging Quantitative and Qualitative:

The most powerful part of this dashboard is its ability to connect the “what” with the “why.” A Table chart is the best way to do this.

  • Create a table with columns for the original feedback_text, the ai_summary, sentiment, and category.

  • This table acts as the ground truth. When a user sees a spike in negative sentiment on the time-series chart, they can look at this table (filtered to that time period) and read the AI-generated summaries to understand the root cause in seconds, without having to read through hundreds of raw entries.

Creating Interactive Controls for Deeper Exploration

A static dashboard presents information; an interactive one invites a conversation. Controls empower your users to slice, dice, and filter the data to answer their own specific questions.

  1. Date Range Control:

This is the most fundamental control. Add a Date range control to the top of your report. This allows users to easily filter the entire dashboard to a specific day, week, month, or custom period.

  1. Filter Controls for AI Dimensions:

This is where the AI enrichment truly shines. Add Drop-down list controls for your key AI-generated fields.

  • Filter by Category: Create a filter linked to the category field. Now, a product manager can select “Feature Request” to see only relevant feedback, or a support manager can filter for “Bug Report.”

  • Filter by Sentiment: Create a filter for the sentiment field. This is incredibly powerful for drilling down. A user can select “Negative” to instantly isolate all problem areas and read the associated summaries.

  1. Enable Cross-Filtering on Charts:

Make your charts themselves act as filters. In Looker Studio, this is often on by default, but it’s good to confirm.

  • Go to each chart’s settings and ensure “Cross-filtering” is enabled under “Interactions.”

  • Now, a user can click on the “Negative” slice of the sentiment pie chart, and the entire dashboard—the time series, the category bar chart, and the detailed feedback table—will instantly filter to show data for only negative feedback. This intuitive, click-based exploration is key to rapid insight discovery.

  1. Keyword Search Box:

For ultimate ad-hoc analysis, add an Input box control. Configure it to act as a search filter on the feedback_text and/or ai_summary fields. This allows a user to type in any keyword (e.g., “login,” “invoice,” “slow”) and immediately see all related feedback entries, their sentiment, and their categories.

Conclusion: Your New Automated Business Insights Engine

Congratulations! You’ve successfully navigated the process of architecting a powerful, AI-driven insights pipeline. What you’ve built is more than just a collection of apps and a dashboard; it’s a dynamic, automated engine for converting raw operational data into strategic business intelligence. You’ve effectively closed the loop between data capture, intelligent analysis, and actionable visualization. Let’s recap the journey and explore where you can go from here.

Recap: The Power of a Fully Integrated AI and App Ecosystem

At the start of this journey, you had unstructured data—customer feedback, sales notes, project updates—locked away in disparate systems or text fields. By weaving together the Google Cloud ecosystem, you’ve created a seamless flow:

  1. Capture & Structure: Your AppSheet application acts as the perfect front-end, providing a user-friendly interface to capture clean, structured data from your team, wherever they are.

  2. Analyze & Enrich: By integrating a Gemini AI model via API calls, you’ve moved beyond simple data storage. You are now programmatically performing sophisticated analysis—like sentiment scoring, summarization, and categorization—to enrich every single data point with a layer of machine intelligence.

  3. Store & Aggregate: This newly enriched data flows into a centralized, scalable data source like [Automated Web Scraping with [Multilingual Text-to-Speech Tool with SocialSheet Streamline Your Social Media Posting 123](https://votuduc.com/Multilingual-Text-to-Speech-Tool-with-Google-Workspace-p809282)](https://votuduc.com/Automated-Web-Scraping-with-Google-Sheets-p292968) or BigQuery, creating a single source of truth for your AI-generated insights.

  4. Visualize & Communicate: Finally, Looker Studio transforms this data into a dynamic, interactive dashboard. Trends, patterns, and outliers that were once invisible are now front and center, ready to inform your next big decision.

The true power lies in the synergy. AppSheet provides the action layer, Gemini provides the intelligence layer, and Looker Studio provides the communication layer. Together, they create a virtuous cycle where capturing more data directly leads to smarter, faster, and more scalable business insights.

Potential Enhancements and Future Directions

What you’ve built is a robust foundation, but it’s just the beginning. The beauty of this modular architecture is its extensibility. Here are a few ideas to take your insights engine to the next level:

  • Close the Loop with Actions: Don’t just view the insights—act on them. Use AppSheet Automation to trigger workflows based on AI analysis. For instance, if a piece of feedback is flagged with a “High Negative” sentiment, automatically create a high-priority task in your project management system and notify the product manager via email.

  • Incorporate Multi-Modal AI: Why stop at text? Use Gemini’s multi-modal capabilities to analyze images uploaded through your AppSheet app. Imagine an app for field service technicians where they can upload a photo of a damaged part, and the AI not only identifies the part but also assesses the severity of the damage and suggests a repair protocol.

  • Implement Predictive Analytics: Move from descriptive to predictive insights. With enough historical data aggregated in BigQuery, you can train a BigQuery ML model to make forecasts. Predict which customers are at risk of churning based on their feedback history, or forecast product demand based on sales notes and market trends.

  • Create a Conversational Interface: Embed a chatbot in your AppSheet app or an internal site that allows users to query your insights data in natural language. Instead of filtering a dashboard, a manager could simply ask, “What was the most common positive feedback for Product X last quarter?”

Streamline Your Workflow with the ContentDrive.app Ecosystem

Building this system from scratch is an incredibly rewarding experience that gives you full control. However, as you look to scale this solution across your organization or deploy new ones, speed and standardization become critical.

This is where the ContentDrive.app ecosystem comes in. We provide a suite of tools, templates, and managed connectors designed to help you build and deploy these AI-powered solutions in a fraction of the time.

  • AppSheet Solution Accelerators: Get started with our library of pre-built AppSheet templates for common use cases like Customer Feedback Management, Competitor Analysis, and Field Service Reporting.

  • Managed AI Connectors: Forget wrestling with complex API authentication and request formatting. Our managed connectors for Gemini, OpenAI, and other leading models plug directly into AppSheet Automation, allowing you to add powerful AI capabilities with just a few clicks.

  • Looker Studio Starter Kits: Don’t start from a blank canvas. Our professionally designed dashboard templates are pre-configured to work seamlessly with our AppSheet apps, giving you a polished, insightful dashboard from day one.

By leveraging the ContentDrive.app ecosystem, you can focus less on the technical plumbing and more on what truly matters: generating the insights that will drive your business forward. Explore our offerings and discover how you can launch your next automated insights engine in hours, not weeks.


Tags

AppSheetLooker StudioAIBusiness IntelligenceDashboardData VisualizationNo-Code

Share


Previous Article
Build an AI Powered Feedback App with AppSheet and Gemini
Vo Tu Duc

Vo Tu Duc

A Google Developer Expert, Google Cloud Innovator

Stop Doing Manual Work. Scale with AI.

Hi, I'm Vo Tu Duc (Danny), a recognised Google Developer Expert (GDE). I architect custom AI agents and Google Workspace solutions that help businesses eliminate chaos and save thousands of hours.

Want to turn these blog concepts into production-ready reality for your team?
Book a Discovery Call

Table Of Contents

1
Introduction: Beyond Data Collection to Automated Intelligence
2
The High-Level Architecture: Connecting the Dots
3
Step 1: Structuring and Capturing Data in AppSheet
4
Step 2: Warehousing and Preparing Data with BigQuery
5
Step 3: Generating Insights with Vertex AI
6
Step 4: Visualizing AI-Powered Insights in Looker Studio
7
Conclusion: Your New Automated Business Insights Engine

Portfolios

AI Agentic Workflows
Cloud Engineering
AppSheet Solutions
Change Management
Strategy Playbooks
Product Showcase
Uncategorized
Workspace Automation

Related Posts

Automate Client Progress Reports in Google Chat with Gemini
May 22, 2026
© 2026, All Rights Reserved.
Powered By

Quick Links

Book a CallAbout MeVolunteer Legacy

Social Media