You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Zapier生产项目本地下载及触发器自定义字段添加技术求助

解决方案:Zapier生产项目本地拉取与字段修改

一、安全拉取生产项目到本地

  • 确认已通过zapier login --sso完成登录,且部署密钥配置生效
  • 使用zapier pull命令同步项目到本地,该操作仅复制代码到本地,完全不会影响生产环境
    • 执行前确保本地目标目录为空,或未关联其他Zapier项目,避免代码冲突
    • 命令格式:zapier pull --app [APP_ID],APP_ID可在开发者仪表板的项目设置页获取

二、为触发器添加自定义字段

提示“This version was created by the CLI and can only be modified there.”说明项目由CLI创建,只能通过本地代码修改后重新部署,无法在UI直接编辑

  • 找到本地项目中对应触发器的代码文件(一般在triggers/目录下)
  • 定位到getProduct函数,添加自定义字段(注意对应实际传入值,不要复用name字段):
const getProduct = (z, bundle) => {
const product = {
    id: bundle.cleanedRequest.id,
    name: bundle.cleanedRequest.name,
    first_field: bundle.cleanedRequest.first_field,
    second_field: bundle.cleanedRequest.second_field,
    // Other existing fields...
};
  • 同时在触发器的outputFields数组中添加字段描述,确保Zapier能识别并展示:
outputFields: [
    {key: 'id', label: 'Product ID'},
    {key: 'name', label: 'Product Name'},
    {key: 'first_field', label: 'First Custom Field'},
    {key: 'second_field', label: 'Second Custom Field'},
    // 其他已有字段...
]
  • 修改完成后,先执行zapier test验证代码无错误,再用zapier push推送到测试环境验证功能,确认无误后再升级到生产环境

内容的提问来源于stack exchange,提问作者Oleh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 04:23:12