Skip to content

Commit 642c44c

Browse files
caoxing9claude
andcommitted
fix(zapier): pass tableId to the View dropdown via altersDynamicFields
The View dropdown returned 0 results with no API call — tableId wasn't reaching the views trigger's bundle, so it early-returned []. Mark the Table field altersDynamicFields so its value propagates to the dependent View dropdown. Add console logs to the views trigger for diagnosis. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d0e7c56 commit 642c44c

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

packages/zapier/src/triggers/new_or_updated_record.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default {
4646
required: true,
4747
dynamic: 'tables.id.name',
4848
search: 'tables.id',
49+
// Pass the chosen table down so the View dropdown (which depends on
50+
// tableId) re-fetches with it in scope.
51+
altersDynamicFields: true,
4952
},
5053
{
5154
key: 'viewId',

packages/zapier/src/triggers/new_record.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export default {
3636
required: true,
3737
dynamic: 'tables.id.name',
3838
search: 'tables.id',
39+
// Pass the chosen table down so the View dropdown (which depends on
40+
// tableId) re-fetches with it in scope.
41+
altersDynamicFields: true,
3942
},
4043
{
4144
key: 'viewId',

packages/zapier/src/triggers/views.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import type { TeableView, DropdownItem } from '../lib/types';
55
// Hidden trigger powering the "View" dropdown. Depends on a chosen tableId.
66
const perform = async (z: ZObject, bundle: Bundle): Promise<DropdownItem[]> => {
77
const { tableId } = bundle.inputData;
8+
z.console.log(`views dropdown: tableId=${tableId ?? '(none)'}`);
89
if (!tableId) return [];
910
const response = await z.request<TeableView[]>({
1011
url: apiUrl(bundle, `/table/${tableId}/view`),
1112
});
12-
return (response.data || []).map((view) => ({
13+
const items = (response.data || []).map((view) => ({
1314
id: view.id,
1415
name: view.name,
1516
}));
17+
z.console.log(`views dropdown: ${items.length} view(s) for table ${tableId}`);
18+
return items;
1619
};
1720

1821
export default {

0 commit comments

Comments
 (0)