1

我想在 Zapier 平台上制作动态字段。如果用户选择“是”,则显示 4-5 个字段,否则不显示。我在 ZOHO CRM 集成 中看到过这种类型的示例,最初只显示 2 个字段

现在只有2个字段。当我们在第一个字段中选择“标准”时,会显示/打开许多字段。 这是显示的所有字段

与此类似,我想要一个有两个选项“是”和“否”的字段。如果用户选择是,则应打开 4-5 个字段(否则不打开)。用户可以使用这些字段来发送数据。

4

1 回答 1

1

这里有关于这个过程的文档(复制如下)

const recipeFields = (z, bundle) => {
  const response = z.request('http://example.com/api/v2/fields.json');
  // json is is [{"key":"field_1"},{"key":"field_2"}]
  return response.then(res => res.json);
};

const App = {
  //...
  creates: {
    create_recipe: {
      //...
      operation: {
        // an array of objects is the simplest way
        inputFields: [
          {
            key: 'title',
            required: true,
            label: 'Title of Recipe',
            helpText: 'Name your recipe!'
          },
          {
            key: 'style',
            required: true,
            choices: { mexican: 'Mexican', italian: 'Italian' }
          },
          recipeFields // provide a function inline - we'll merge the results!
        ],
        perform: () => {}
      }
    }
  }
};

在您的情况下,您将用style是/否替换该字段。该recipeFields函数将有一条if语句检查 的值bundle.inputData.style并返回更多字段对象或[],具体取决于是否应显示更多字段。

于 2019-06-28T18:34:33.587 回答