Do we have any statistical reports data for uses of Squidex, such as how many assertions we used? how many word count, etc…
No, sorry…what do you mean with assertions and word counts?
word count is all post content in an app, and assert is also used in an app.
The answer is “No”, but I still have idea what you mean with assertions.
The assert I found an API getAssets
, and get all the uploads by total
property.
1 Like
I create a statistics of single schema, and it has a wordCount number filed.
I tried using a custom script to handle it, but I can’t update another schema. Do we have any support method for updating another schema in a schema?
// 统计数据的 ID(请手动从 Squidex 后台获取)
const STATISTICS_ID = "96604a9e-e2e1-4d36-94c6-a620b8810e9b"; // 请替换为你的实际 ID
// 1. 获取当前内容的文本字段(假设字段是 'content')
const text = ctx.data.content?.iv || "";
// 2. 计算当前内容的字数
const wordCount = characterCount(text);
// 3. 查询统计 Schema 的数据
getReference(STATISTICS_ID, stats => {
if (stats.length > 0) {
// 4. 统计数据已存在,更新 totalWordCount
const stat = stats[0]; // 由于 getReference() 返回数组,取第一个元素
const currentCount = stat.data?.totalWordCount?.iv || 0;
const newCount = currentCount + textWordCount;
stat.data.totalWordCount.iv = newCount
replace('statistics', STATISTICS_ID, {
data: {
totalWordCount: { iv: newCount }
}
});
} else {
// 5. 如果 `getReference()` 失败,则说明统计数据未创建(理论上不应发生)
console.log("统计数据不存在,请检查 STATISTICS_ID 是否正确");
}
});
reference from Scripting | Squidex
At the moment there is nothing for that. You could solve it with a webhook.