I have a workbook with two clay tables. Table A and Table B. Table B has a single text column with JSON data in it. Table A has a list of people records one row per person. How can I reference the text column from Table B in the other clay table in a AI prompt I am building?
To reference the JSON text column from Table B in your AI prompt in Table A, you can use our "write to table" feature to first copy the JSON data to Table A, then reference it directly.
Alternatively, when building your AI prompt in Table A, use the forward slash (/
) to access the menu and reference data from other columns. In the Prompt Editor, you can insert dynamic fields to customize content - simply type /
and select the column containing your JSON data from the dropdown menu.
Once referenced, you can use the JSON data as context in your AI prompt by creating variables with curly brackets notation, like {JSONData} = /Your_JSON_Column_Name
.
I don't want the JSON text column from Table B to be in every row in Table A. Is it not possible to use the JSON text column in my prompt and just reference TableName.Column Name or something similar.
No, Clay doesn't support TableName.ColumnName syntax for cross-table references in AI prompts. You can only reference data from columns within the same table using the forward slash (/) to access the menu. To use your JSON data from Table B in Table A's AI prompts, you'll need to use our "write to table" feature to copy the JSON column to Table A first. Once copied, you can then reference it in your AI prompts using the / menu.
Does that mean the json column would appear for every row in my table?
Yes, when you use "write to table" to copy the JSON column from Table B to Table A, the JSON data will appear in every row of Table A. The "write to table" feature copies columns from one table to another, keeping data aligned and consistent across tables. This means the JSON column will be duplicated to match the structure of your destination table, resulting in the same JSON data appearing in each row of Table A.
Hello Malik! Thanks for reaching out! Do you mind sending the table link URLs for both tables and the column you want to reference? You would have to send data from table B to table A either through lookup or send table data. If you have a common column you can reference between the two you can perform a lookup. https://www.clay.com/university/guide/lookup-rows