我想在Zapier平台上创建动态字段。如果用户选择“是”,则显示4-5个字段,否则不显示。我在ZOHO CRM集成where only 2 fields are shown at first中见过这种类型的示例。
现在只有2个字段。当我们在第一个字段中选择“标准”时,会显示/打开许多字段。Here are all the fields that show up
与此类似,我想要一个字段,其中有两个选项,“是”和“否”。如果用户选择是,则应打开4-5个字段(否则不会打开)。用户可以使用这些字段发送数据。
发布于 2019-06-29 02:34:34
这里有关于这个过程的文档here (复制如下)
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: () => {}
}
}
}
};
在本例中,您将用yes/no替换style
字段。recipeFields
函数将有一条if
语句来检查bundle.inputData.style
的值,并返回更多的字段对象或[]
,这取决于是否应该显示更多的字段。
https://stackoverflow.com/questions/56804655
复制相似问题