Yida Business Rule logo

Yida Business Rule

Organization
openyida
yida-business-rule

宜搭表单业务关联规则与高级函数配置。用于在表单设置中配置业务关联规则,或使用 INSERT、UPDATE、DELETE、UPSERT 高级函数实现跨表增删改。适用于需要表单间数据联动的场景。

Overview

Publisheropenyida
Repositoryopenyida
Skill nameyida-business-rule
Stars
228
Forks
50
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by openyida on GitHub. Read the source before you install it.

Installation

Install the Yida Business Rule AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/openyida/openyida/tree/main/yida-skills/skills/yida-business-rule
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openyida/openyida.git /tmp/openyida
mkdir -p .claude/skills
cp -r /tmp/openyida/yida-skills/skills/yida-business-rule .claude/skills/yida-business-rule
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Yida Business Rule in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Yida Business Rule on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Yida Business Rule is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

yida-business-rule — 业务关联规则高级函数

适用范围

业务关联规则是宜搭表单设置里的旧式/低频跨表联动能力。用户明确提到以下意图时使用本技能:

  • "业务关联规则"、"表单事件里的公式执行"
  • "高级函数"、"INSERT"、"UPDATE"、"DELETE"、"UPSERT"
  • "要在表单设置里配 upsert/update/delete/insert"
  • 明确不想用集成自动化,而要用公式函数做跨表增删改

配置入口

在表单设计器里进入:

text
表单设置 → 表单事件 → 公式执行 → 添加业务关联规则

业务关联规则弹窗包含三个事件输入框:

事件触发时机
单据提交新增记录提交成功后
单据删除删除记录成功后
单据编辑编辑记录提交成功后

点击事件输入框会打开「公式执行」编辑器。配置完成后必须依次确认:公式弹窗 → 业务关联规则弹窗 → 保存表单。

关键原则:必须插入令牌

编写前通过 use_skill 加载 yida-formula,查看“写配置前先处理这些易错点”,共用函数和字段选择方法。业务动作保留目标表、当前数据、事件及完整规则;条件中的 AND/EQ 等按该动作的查询条件含义处理。通用表达式试算不执行这些写数据动作;保存回读与实际新增、修改、删除结果分别说明。

业务关联公式不是普通字段公式。普通字段公式引用字段用 #{fieldId};业务关联规则引用目标表、目标字段、当前表字段时,必须在公式编辑器左侧列表点击插入令牌。

不要直接手敲中文表单名或字段名。实际验证中,手敲下面这种文本会报非法标识符:

text
UPSERT(Upsert目标,EQ(Upsert目标.键,"x"),"",Upsert目标.键,"x")

正确方式是在编辑器中输入函数名、括号、逗号、字符串常量,然后点击左侧字段列表插入 Upsert目标、Upsert目标.键 等令牌。最终输入框看起来可能和手敲文本相似,但内部结构不同。

高级函数签名

函数格式说明
INSERTINSERT(目标表, 目标列1, 目标值1, 目标列2, 目标值2, ...)向目标表插入新实例
UPDATEUPDATE(目标表, 主条件, 子条件, 目标列1, 目标值1, ...)更新目标表中满足条件的数据
UPSERTUPSERT(目标表, 主条件, 子条件, 目标列1, 目标值1, ...)有匹配数据则更新,无匹配数据则插入
DELETEDELETE(目标表, 主条件, 子条件)删除目标表中满足条件的数据

子条件 用于定位目标表某条数据下的子表单明细。不操作子表单时必须写 "",不能省略。

UPSERT 模板

普通主表字段 upsert:

text
UPSERT(目标表, EQ(目标表.业务键, 当前表业务键), "", 目标表.业务键, 当前表业务键, 目标表.目标字段, 当前表来源字段)

库存类示例:

text
UPSERT(存货表, EQ(存货表.商品名, 商品名), "", 存货表.商品名, 商品名, 存货表.存货量, 存货表.存货量 + 进货量)

固定值探测示例:

text
UPSERT(Upsert目标, EQ(Upsert目标.键, "_openyida_upsert_probe"), "", Upsert目标.键, "_openyida_upsert_probe", Upsert目标.备注, "configured from form settings")

以上示例中的表单名和字段名只是可读展示。真实配置时,所有表单和字段引用都要从左侧列表点击插入令牌。

条件规则

  • 主条件、子条件 必须由逻辑函数构造,常见为 EQ()、AND()、OR()。
  • 除 AND()、OR() 外,逻辑函数第一个参数必须是目标表组件,例如 EQ(存货表.商品名, 商品名)。
  • 不要把当前表字段写在 EQ() 第一个参数,也不要在第一个参数里嵌套其他函数。
  • 更新普通组件时,目标列 必须是目标表普通组件。
  • 更新子表单明细时,目标列 必须是对应明细下的组件。
  • 同一个高级函数里不要同时更新普通组件和明细组件;需要拆成多条规则或多个函数。

浏览器配置步骤

  1. 确认触发表单和目标表单都在同一应用内。
  2. 用 openyida get-schema <appType> <formUuid> 查清目标字段和来源字段,避免点错。
  3. 打开触发表单设计器,进入 表单设置 → 表单事件 → 公式执行 → 添加业务关联规则。
  4. 点击要配置的事件输入框,例如 单据编辑。
  5. 在公式编辑器中只手动输入函数名、括号、逗号、字符串常量。
  6. 目标表、目标列、来源字段全部从左侧列表点击插入令牌。
  7. 每插入一个令牌后暂停并校验公式显示,避免 CodeMirror 光标错位。
  8. 点击公式弹窗「确定」。如果能回到业务关联规则弹窗,说明公式通过编辑器校验。
  9. 点击业务关联规则弹窗「确定」,最后点击表单设计器「保存」并确认保存成功。

用量限制

函数目标表类型用量限制
INSERT主表批量导入无条数限制,建议单次不超过 1000 条
INSERT子表单插入主表免费版 ≤50 条;轻享/专业/专属版 ≤500 条
UPDATE主表单次最多更新 100 条,超出会报错
UPDATE子表单免费版 ≤50 条;轻享/专业/专属版 ≤500 条
UPSERT主表单次最多 100 条,超出会报错
UPSERT子表单免费版 ≤50 条;轻享/专业/专属版 ≤500 条
DELETE主表单次最多删除 100 条
DELETE子表单轻享/专业/专属版 ≤500 条

常见错误

错误原因处理
该标识符不合法手敲了表单名/字段名从左侧列表点击插入令牌
Unexpected end of input公式未闭合或必填参数缺失检查括号、逗号、子条件
规则未触发配在错误事件或未保存表单检查 单据提交/删除/编辑 和保存结果
更新结果过多条件不够精确或超出限制收紧 主条件,必要时改用集成自动化

参考

  • 宜搭帮助中心:表单业务规则
  • 宜搭帮助中心:INSERT / UPDATE / UPSERT / DELETE 业务关联公式

Frequently asked questions

What does the Yida Business Rule AI skill do?

宜搭表单业务关联规则与高级函数配置。用于在表单设置中配置业务关联规则,或使用 INSERT、UPDATE、DELETE、UPSERT 高级函数实现跨表增删改。适用于需要表单间数据联动的场景。

Why use Yida Business Rule on TypingMind?

Because you install it once and use it with any model. Yida Business Rule is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Yida Business Rule in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/openyida/openyida/tree/main/yida-skills/skills/yida-business-rule. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Yida Business Rule?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Yida Business Rule?

As many as you like. As long as a model supports skills, you can use Yida Business Rule with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Yida Business Rule AI skill free?

Yes. It is published on GitHub by openyida under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇