In this quick start, you'll extend the Update car inventory automation using AI to categorize the car by body style. This quick start also illustrates how to test a step in your automation.
To update an automation to categorize the car by body style, do the following steps:
- Complete the prerequisite quick start
- Update the AppSheet database
- Regenerate the table in the app
- Add an automation step to categorize cars by body style using AI
- Test the step in your automation
Step 1: Complete the prerequisite quick start
As a prerequisite, you must complete Quick start: Extract information from an image using AI.
Step 2: Update the AppSheet database
Update the Car inventory AppSheet database, that you created in Quick start: Extract information from an image using AI.
To update the AppSheet database, do the following:
- Open the Car inventory AppSheet database in the database editor, or navigate to its tab.
- In the AppSheet database editor, add a new body style column, as follows:
- Click + Add column in the column header.
- Change the Name field to Body style.
- Set the Type field to Enum.
- Set the Item type field to Dropdown.
- Click in the first option field and enter Sedan.
- Click Add option, enter Coupe, and set the color to white.
- Repeat step f to add the following options: Hatchback, SUV, Pickup, Minivan, Other
Note: "Other" will be used to catch body styles that aren't in the list of options. - Click Save.
- Click + Add column in the column header.
Next, you'll regenerate the app schema in the Car inventory app.
Step 3: Regenerate the table in the app
Regenerate the Car inventory table in the Car inventory app, originally created in Quick start: Extract information from an image using AI.
To regenerate the table in your app, do the following:
- Open the Car inventory app in the app editor, or navigate to its tab.
- In the app editor, in the left navigation, click
to display the Data pane (if it isn't already displayed).
Note that there is a warning message indicating that the app schema is out of sync with the data source.
- Click Regenerate schema
in the table header.
- Click Regenerate to confirm the action.
AppSheet regenerates the Car inventory table to sync with the changes made to the AppSheet database and the warning message is removed.
Step 4: Add an automation step to categorize cars by body style using AI
To add a step to the automation to categorize cars by type using the Categorize AI task, do the following:
- In the app editor, go to Automation
and select the Update car inventory bot.
- In the bot flow in the center pane, click + Add a step.
- For Step name, enter Categorize by body style and click Create a new step.
- Edit the task configuration settings in the right pane, as follows:
- Set the task type to AI task.
- In the AI task drop-down, select Categorize. This AI task type categorizes information.
- Under Input columns:
- Notice that the first column is added and set to Make.
Leave this column selection as is. - Click Add and select Model in the drop-down, if it's not already selected.
- Click Add and select Year in the drop-down, if it's not already selected.
Note: Don't select any other columns.
The Input columns section appears as follows:
- Notice that the first column is added and set to Make.
- Under Output:
- Turn on Save to table (if it isn't already selected) to save the extracted information to the AppSheet database.
- Click to open the drop-down and select Body style.
Recall that Body style is anEnum
column that defines the body styles that will be used to categorize the car.
- In the Additional instructions field, enter: If not sure of body style, set to "Other"
The Settings pane appears as follows:
- Click Save to save the app.
Step 5: Test the step in your automation
You can test a step in your automation--without updating any rows in your data source.
To test the step in your automation, do the following:
- Click
at the top of the right pane.
The Test step pane is displayed.
Note: If you are prompted to refresh the data, click Refresh.
The first (and only) row of app data is selected for the test input.
Note: If you had multiple rows of app data, you might click Select row to select a different row to test. - Click Run test at the bottom of the right pane to test the current row of data.
The Results section is updated to reflect the body style of the car.
Congratulations! You have built an automation to categorize information using AI.
What's next?
- Explore more Gemini-based quick starts to learn about AI in automations.
- Explore other quick starts to learn about other AppSheet features.