Using JSON data as a variable in AI components

Introduction

JSON (JavaScript Object Notation) is a widely used format to store and share structured data. Glide lets you create JSON objects or JSON templates from your app’s data, which can then be used as variable values in AI components. This helps you send detailed, organized data into AI features for smarter, more dynamic app behaviors - all without needing to write code.

When to Use This

  • To dynamically provide structured app data to Glide AI components.
  • This helps with generate a set of components (e.g: a list of cards) instead of one single component.

Step-by-Step Guide

Step 1: Create a JSON Template Column

In Glide’s Data Editor, open the table to use. Add a new column and select type JSON Template (found under Integrations → JSON → JSON Template). Enter your JSON structure with keys in quotes and values starting with a $ to reference Glide columns.
Example:

{ "name": "$Name", "age": $Age }

 

Step 2: Bind Data to the JSON Template

Add key-value pairs to connect your JSON placeholders (like $Name) to actual columns in your table. Glide fills the template with real data for each row automatically.

Step 3: Use the JSON Column in AI Components

Configure an AI component in your app’s layout or automation. When setting it up, select the JSON Template column as a variable input, allowing the AI to process the structured data.

Step 4: Test and Adjust

Preview your app to confirm the AI component receives and uses the JSON data correctly. Simplify your JSON templates if data doesn’t appear as expected, then build up complexity gradually.

Fixing Common Problems

Problem: AI component does not get the right JSON data.
Solution: Check JSON syntax carefully - keys must be strings with quotes and values referencing columns need the $ prefix. Make sure referenced columns exist and hold valid data. Test with very simple JSON first.

Problem: JSON data does not update when data changes.
Solution: Ensure Glide table refreshes and JSON columns recalculate properly. Avoid using hardcoded values that stop dynamic updates.


Was this article helpful?
© 2025 LowCode Internal Docs