【问题标题】:Zapier static dropdown displays message regarding loading more optionsZapier 静态下拉列表显示有关加载更多选项的消息
【发布时间】:2022-01-02 06:30:22
【问题描述】:

我有 Zapier 搜索操作的代码:

      {
        key: 'field0',
        label: 'Field 0',
        required: true,
        choices: { field1: 'Field1', field2: 'Field2' },
        altersDynamicFields: true,
      },
      function (z, bundle) {
        if (bundle.inputData['field0'] === 'field1') {
          return [{ 
            key: 'field1',  
            type: 'string', 
            required: true, 
            label: 'Field1' 
          }];
        }
        if (bundle.inputData['field0'] === 'field2') {
          return [{ 
            key: 'field2', 
            type: 'string', 
            required: true,
            label: 'Field2' 
          }];
        }
        return [];
      },
    ]

它按预期工作 - 根据用户选择呈现字段,但是在下拉选项上方我看到以下消息:

我们找不到更多选择。
抱歉,没有更多选择。我们已经加载了所有 2 个。

我如何摆脱这条消息?

【问题讨论】:

  • 我目前遇到了同样的问题。你找到解决办法了吗?
  • 很遗憾还没有。
  • 我最终添加了一个隐藏触发器并在那里返回一个静态数组。这消除了您也遇到的错误,但会引入一点加载时间。但我仍然更喜欢这个而不是错误消息。
  • 是的,看起来好多了。

标签: javascript zapier zapier-cli


【解决方案1】:

尝试使用case switch control代替。它看起来更干净,不会给出任何警告错误。

field = bundle.inputData.field0
 switch (field) {
          case "field1":
              return [{ 
            key: 'field1',  
            type: 'string', 
            required: true, 
            label: 'Field1' 
          }];
            case "field2":
              return [{ 
            key: 'field2',  
            type: 'string', 
            required: true, 
            label: 'Field2' 
          }];
              default:
            return [];
        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-15
    • 1970-01-01
    • 2019-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-05
    相关资源
    最近更新 更多