如何在服务器脚本的appmaker中查找"记录"的字段类型信息?



我正在尝试创建一个可重复使用的脚本,以通过服务器端脚本捕获记录更改。为此,我需要给定表的模型信息,包括每个字段的类型。

我已经弄清楚了如何获取我的桌子的模型以及字段的详细信息:

var table = "Clients";
var myObject = app.models[table];
// Dump the properties of the 2nd field in the model
console.log("Field 2 properties: " + JSON.stringify(myObject["L"]["fields"]["1"]));

我看到了:

{"name":"Client",
"key":"zzzkS1spSPKkRXMn",
"displayName":null,
"description":"Short name for client (must be unique)",
"type":{},
"required":false,
"uid":false,
"defaultValue":null,
"minLength":0,
"maxLength":null,
"integer":false,
"sortable":true,
"minValue":null,
"maxValue":null,
"regexp":null,
"regexpError":null,
"possibleValues":null,
"aggregationType":null
}

" type"看起来像一个空属性,我似乎无法弄清楚如何获取任何参考来告诉我我的需求。

如何在模型中获得给定字段的可用类型信息?

现在,应用程序制造商不会公开API访问模型元数据。您的摘要实际上正在访问应用程序制造商的内部状态,并可能会破坏以后的发行版(" L"属性实际上是由JS编译器迷惑的,而不是从用户陆地访问的(。

我们知道这种元编程非常方便,这是我们将来根据用户反馈添加的东西。请随时在我们的发行跟踪器(https://developers.google.com/appmaker/support(中提交请求功能。

最新更新