Array data type 编辑

Use the Array data type to configure multiple returns in your service action’s configured JSON body. This is useful when developing your microapps to use the multiselect lookup component in page builder.

To configure an array data type, follow these steps:

  • Enter the name for your array.
  • Select the array data type and choose the subtype for items in the array. Depending on your multi select lookup requirements, the array subtype can be a primitive data type or an object with multiple parameters. Primitive data types result in a list of values, and multiple parameters result in a list of objects with values.
  • Use Add object parameter and add as many parameters as you require. For example, in the following image, every object in the users array can contain userName and userEmail parameters:

Array data type

Configure JSON body

When configuring the JSON body of your array, use mustache tags to reference parameter and template variable names. For example, {{parameterName}}.

For extra configuration options, the JSON body supports handlebars formatting including helpers, data variables as defined in the handlebars format in addition to context changing:

Array JSON configuration

You can also test your configured JSON template by using the test with parameters feature. This provides feedback on whether your JSON body is configured correctly and valid JSON is generated during action execution.

Mustache tags are either replaced with actual values and enquoted automatically if needed or replaced with null during JSON body template processing. It is also possible to enforce value enquoting with the enquote Handlebar helper.

Examples:

Enquote examples

Array examples:

Array examples

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:97 次

字数:2950

最后编辑:6年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文