Google Data Studio-我可以在创建连接器视图时验证配置参数吗?

时间:2019-04-24 07:11:29

标签: google-data-studio

当前,我正在getData函数中验证连接器的配置,但这不是非常用户友好。


RequestParamsValidator.prototype.validate = function validate(request) {
  if (!request.configParams || !request.configParams.account_id) {
    ErrorUtils.throwUserError('Account id is required. Please check connector config and try again.');
  }
};

您是否知道是否有任何检查方法(可能未记录),例如字段的值为空,是否阻止用户创建连接器?

我检查了此参考,但没有任何有关验证的信息: https://developers.google.com/apps-script/reference/data-studio/text-input

1 个答案:

答案 0 :(得分:1)

您可以在getSchema的开头验证配置。这将防止用户越过配置屏幕。这是Kaggle connector中的示例实现。