@wagemule/daemon 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/README.md +9 -2
  2. package/dist/main.cjs +270 -101
  3. package/dist/main.cjs.map +3 -3
  4. package/dist/skills/larksuite/lark-approval/SKILL.md +56 -0
  5. package/dist/skills/larksuite/lark-attendance/SKILL.md +57 -0
  6. package/dist/skills/larksuite/lark-base/SKILL.md +349 -0
  7. package/dist/skills/larksuite/lark-base/references/dashboard-block-data-config.md +350 -0
  8. package/dist/skills/larksuite/lark-base/references/examples.md +140 -0
  9. package/dist/skills/larksuite/lark-base/references/formula-field-guide.md +735 -0
  10. package/dist/skills/larksuite/lark-base/references/lark-base-advperm-disable.md +83 -0
  11. package/dist/skills/larksuite/lark-base/references/lark-base-advperm-enable.md +80 -0
  12. package/dist/skills/larksuite/lark-base/references/lark-base-base-copy.md +74 -0
  13. package/dist/skills/larksuite/lark-base/references/lark-base-base-create.md +68 -0
  14. package/dist/skills/larksuite/lark-base/references/lark-base-base-get.md +39 -0
  15. package/dist/skills/larksuite/lark-base/references/lark-base-cell-value.md +151 -0
  16. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-arrange.md +83 -0
  17. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-block-create.md +108 -0
  18. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-block-delete.md +46 -0
  19. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-block-get.md +57 -0
  20. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-block-list.md +53 -0
  21. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-block-update.md +84 -0
  22. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-create.md +73 -0
  23. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-delete.md +44 -0
  24. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-get.md +59 -0
  25. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-list.md +52 -0
  26. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard-update.md +69 -0
  27. package/dist/skills/larksuite/lark-base/references/lark-base-dashboard.md +240 -0
  28. package/dist/skills/larksuite/lark-base/references/lark-base-data-analysis-sop.md +88 -0
  29. package/dist/skills/larksuite/lark-base/references/lark-base-data-query.md +451 -0
  30. package/dist/skills/larksuite/lark-base/references/lark-base-field-create.md +104 -0
  31. package/dist/skills/larksuite/lark-base/references/lark-base-field-delete.md +51 -0
  32. package/dist/skills/larksuite/lark-base/references/lark-base-field-get.md +42 -0
  33. package/dist/skills/larksuite/lark-base/references/lark-base-field-list.md +44 -0
  34. package/dist/skills/larksuite/lark-base/references/lark-base-field-search-options.md +48 -0
  35. package/dist/skills/larksuite/lark-base/references/lark-base-field-update.md +166 -0
  36. package/dist/skills/larksuite/lark-base/references/lark-base-field.md +23 -0
  37. package/dist/skills/larksuite/lark-base/references/lark-base-form-create.md +87 -0
  38. package/dist/skills/larksuite/lark-base/references/lark-base-form-delete.md +64 -0
  39. package/dist/skills/larksuite/lark-base/references/lark-base-form-get.md +68 -0
  40. package/dist/skills/larksuite/lark-base/references/lark-base-form-list.md +73 -0
  41. package/dist/skills/larksuite/lark-base/references/lark-base-form-questions-create.md +118 -0
  42. package/dist/skills/larksuite/lark-base/references/lark-base-form-questions-delete.md +68 -0
  43. package/dist/skills/larksuite/lark-base/references/lark-base-form-questions-list.md +84 -0
  44. package/dist/skills/larksuite/lark-base/references/lark-base-form-questions-update.md +92 -0
  45. package/dist/skills/larksuite/lark-base/references/lark-base-form-questions.md +23 -0
  46. package/dist/skills/larksuite/lark-base/references/lark-base-form-update.md +82 -0
  47. package/dist/skills/larksuite/lark-base/references/lark-base-form.md +24 -0
  48. package/dist/skills/larksuite/lark-base/references/lark-base-history.md +16 -0
  49. package/dist/skills/larksuite/lark-base/references/lark-base-record-batch-create.md +58 -0
  50. package/dist/skills/larksuite/lark-base/references/lark-base-record-batch-update.md +53 -0
  51. package/dist/skills/larksuite/lark-base/references/lark-base-record-delete.md +62 -0
  52. package/dist/skills/larksuite/lark-base/references/lark-base-record-history-list.md +86 -0
  53. package/dist/skills/larksuite/lark-base/references/lark-base-record-share-link-create.md +72 -0
  54. package/dist/skills/larksuite/lark-base/references/lark-base-record-upload-attachment.md +50 -0
  55. package/dist/skills/larksuite/lark-base/references/lark-base-record-upsert.md +64 -0
  56. package/dist/skills/larksuite/lark-base/references/lark-base-record.md +29 -0
  57. package/dist/skills/larksuite/lark-base/references/lark-base-role-create.md +89 -0
  58. package/dist/skills/larksuite/lark-base/references/lark-base-role-delete.md +83 -0
  59. package/dist/skills/larksuite/lark-base/references/lark-base-role-get.md +87 -0
  60. package/dist/skills/larksuite/lark-base/references/lark-base-role-list.md +81 -0
  61. package/dist/skills/larksuite/lark-base/references/lark-base-role-update.md +94 -0
  62. package/dist/skills/larksuite/lark-base/references/lark-base-shortcut-field-properties.md +481 -0
  63. package/dist/skills/larksuite/lark-base/references/lark-base-table-create.md +62 -0
  64. package/dist/skills/larksuite/lark-base/references/lark-base-table-delete.md +51 -0
  65. package/dist/skills/larksuite/lark-base/references/lark-base-table-get.md +46 -0
  66. package/dist/skills/larksuite/lark-base/references/lark-base-table-list.md +43 -0
  67. package/dist/skills/larksuite/lark-base/references/lark-base-table-update.md +49 -0
  68. package/dist/skills/larksuite/lark-base/references/lark-base-table.md +20 -0
  69. package/dist/skills/larksuite/lark-base/references/lark-base-view-create.md +50 -0
  70. package/dist/skills/larksuite/lark-base/references/lark-base-view-delete.md +48 -0
  71. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-card.md +38 -0
  72. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-filter.md +38 -0
  73. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-group.md +38 -0
  74. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-sort.md +38 -0
  75. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-timebar.md +38 -0
  76. package/dist/skills/larksuite/lark-base/references/lark-base-view-get-visible-fields.md +28 -0
  77. package/dist/skills/larksuite/lark-base/references/lark-base-view-get.md +38 -0
  78. package/dist/skills/larksuite/lark-base/references/lark-base-view-list.md +44 -0
  79. package/dist/skills/larksuite/lark-base/references/lark-base-view-rename.md +44 -0
  80. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-card.md +55 -0
  81. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-filter.md +181 -0
  82. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-group.md +65 -0
  83. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-sort.md +63 -0
  84. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-timebar.md +51 -0
  85. package/dist/skills/larksuite/lark-base/references/lark-base-view-set-visible-fields.md +46 -0
  86. package/dist/skills/larksuite/lark-base/references/lark-base-view.md +44 -0
  87. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-create.md +180 -0
  88. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-disable.md +94 -0
  89. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-enable.md +94 -0
  90. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-get.md +147 -0
  91. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-guide.md +718 -0
  92. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-list.md +124 -0
  93. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-schema.md +935 -0
  94. package/dist/skills/larksuite/lark-base/references/lark-base-workflow-update.md +167 -0
  95. package/dist/skills/larksuite/lark-base/references/lark-base-workflow.md +23 -0
  96. package/dist/skills/larksuite/lark-base/references/lark-base-workspace.md +18 -0
  97. package/dist/skills/larksuite/lark-base/references/lookup-field-guide.md +510 -0
  98. package/dist/skills/larksuite/lark-base/references/role-config.md +539 -0
  99. package/dist/skills/larksuite/lark-calendar/SKILL.md +154 -0
  100. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-agenda.md +78 -0
  101. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-create.md +109 -0
  102. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-freebusy.md +124 -0
  103. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-room-find.md +113 -0
  104. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-rsvp.md +42 -0
  105. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-schedule-meeting.md +265 -0
  106. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-suggestion.md +125 -0
  107. package/dist/skills/larksuite/lark-calendar/references/lark-calendar-update.md +105 -0
  108. package/dist/skills/larksuite/lark-contact/SKILL.md +45 -0
  109. package/dist/skills/larksuite/lark-contact/references/lark-contact-get-user.md +19 -0
  110. package/dist/skills/larksuite/lark-contact/references/lark-contact-search-user.md +124 -0
  111. package/dist/skills/larksuite/lark-doc/SKILL.md +69 -0
  112. package/dist/skills/larksuite/lark-doc/references/lark-doc-create.md +89 -0
  113. package/dist/skills/larksuite/lark-doc/references/lark-doc-fetch.md +141 -0
  114. package/dist/skills/larksuite/lark-doc/references/lark-doc-md.md +71 -0
  115. package/dist/skills/larksuite/lark-doc/references/lark-doc-media-download.md +50 -0
  116. package/dist/skills/larksuite/lark-doc/references/lark-doc-media-insert.md +114 -0
  117. package/dist/skills/larksuite/lark-doc/references/lark-doc-media-preview.md +41 -0
  118. package/dist/skills/larksuite/lark-doc/references/lark-doc-search.md +217 -0
  119. package/dist/skills/larksuite/lark-doc/references/lark-doc-update.md +252 -0
  120. package/dist/skills/larksuite/lark-doc/references/lark-doc-whiteboard.md +100 -0
  121. package/dist/skills/larksuite/lark-doc/references/lark-doc-xml.md +169 -0
  122. package/dist/skills/larksuite/lark-doc/references/style/lark-doc-create-workflow.md +56 -0
  123. package/dist/skills/larksuite/lark-doc/references/style/lark-doc-style.md +106 -0
  124. package/dist/skills/larksuite/lark-doc/references/style/lark-doc-update-workflow.md +54 -0
  125. package/dist/skills/larksuite/lark-drive/SKILL.md +343 -0
  126. package/dist/skills/larksuite/lark-drive/references/lark-drive-add-comment.md +169 -0
  127. package/dist/skills/larksuite/lark-drive/references/lark-drive-apply-permission.md +77 -0
  128. package/dist/skills/larksuite/lark-drive/references/lark-drive-create-folder.md +73 -0
  129. package/dist/skills/larksuite/lark-drive/references/lark-drive-create-shortcut.md +103 -0
  130. package/dist/skills/larksuite/lark-drive/references/lark-drive-delete.md +79 -0
  131. package/dist/skills/larksuite/lark-drive/references/lark-drive-download.md +31 -0
  132. package/dist/skills/larksuite/lark-drive/references/lark-drive-export-download.md +50 -0
  133. package/dist/skills/larksuite/lark-drive/references/lark-drive-export.md +119 -0
  134. package/dist/skills/larksuite/lark-drive/references/lark-drive-import.md +154 -0
  135. package/dist/skills/larksuite/lark-drive/references/lark-drive-move.md +120 -0
  136. package/dist/skills/larksuite/lark-drive/references/lark-drive-pull.md +137 -0
  137. package/dist/skills/larksuite/lark-drive/references/lark-drive-push.md +162 -0
  138. package/dist/skills/larksuite/lark-drive/references/lark-drive-reactions.md +113 -0
  139. package/dist/skills/larksuite/lark-drive/references/lark-drive-search.md +239 -0
  140. package/dist/skills/larksuite/lark-drive/references/lark-drive-status.md +137 -0
  141. package/dist/skills/larksuite/lark-drive/references/lark-drive-task-result.md +302 -0
  142. package/dist/skills/larksuite/lark-drive/references/lark-drive-upload.md +101 -0
  143. package/dist/skills/larksuite/lark-event/SKILL.md +145 -0
  144. package/dist/skills/larksuite/lark-event/references/lark-event-im.md +86 -0
  145. package/dist/skills/larksuite/lark-im/SKILL.md +162 -0
  146. package/dist/skills/larksuite/lark-im/references/lark-im-chat-create.md +162 -0
  147. package/dist/skills/larksuite/lark-im/references/lark-im-chat-identity.md +55 -0
  148. package/dist/skills/larksuite/lark-im/references/lark-im-chat-list.md +113 -0
  149. package/dist/skills/larksuite/lark-im/references/lark-im-chat-messages-list.md +142 -0
  150. package/dist/skills/larksuite/lark-im/references/lark-im-chat-search.md +136 -0
  151. package/dist/skills/larksuite/lark-im/references/lark-im-chat-update.md +84 -0
  152. package/dist/skills/larksuite/lark-im/references/lark-im-flag-cancel.md +67 -0
  153. package/dist/skills/larksuite/lark-im/references/lark-im-flag-create.md +67 -0
  154. package/dist/skills/larksuite/lark-im/references/lark-im-flag-list.md +100 -0
  155. package/dist/skills/larksuite/lark-im/references/lark-im-messages-mget.md +95 -0
  156. package/dist/skills/larksuite/lark-im/references/lark-im-messages-reply.md +222 -0
  157. package/dist/skills/larksuite/lark-im/references/lark-im-messages-resources-download.md +94 -0
  158. package/dist/skills/larksuite/lark-im/references/lark-im-messages-search.md +217 -0
  159. package/dist/skills/larksuite/lark-im/references/lark-im-messages-send.md +223 -0
  160. package/dist/skills/larksuite/lark-im/references/lark-im-reactions.md +297 -0
  161. package/dist/skills/larksuite/lark-im/references/lark-im-threads-messages-list.md +111 -0
  162. package/dist/skills/larksuite/lark-mail/SKILL.md +648 -0
  163. package/dist/skills/larksuite/lark-mail/references/lark-mail-decline-receipt.md +115 -0
  164. package/dist/skills/larksuite/lark-mail/references/lark-mail-draft-create.md +123 -0
  165. package/dist/skills/larksuite/lark-mail/references/lark-mail-draft-edit.md +400 -0
  166. package/dist/skills/larksuite/lark-mail/references/lark-mail-forward.md +232 -0
  167. package/dist/skills/larksuite/lark-mail/references/lark-mail-message.md +230 -0
  168. package/dist/skills/larksuite/lark-mail/references/lark-mail-messages.md +108 -0
  169. package/dist/skills/larksuite/lark-mail/references/lark-mail-reply-all.md +206 -0
  170. package/dist/skills/larksuite/lark-mail/references/lark-mail-reply.md +242 -0
  171. package/dist/skills/larksuite/lark-mail/references/lark-mail-send-receipt.md +120 -0
  172. package/dist/skills/larksuite/lark-mail/references/lark-mail-send.md +216 -0
  173. package/dist/skills/larksuite/lark-mail/references/lark-mail-share-to-chat.md +87 -0
  174. package/dist/skills/larksuite/lark-mail/references/lark-mail-signature.md +98 -0
  175. package/dist/skills/larksuite/lark-mail/references/lark-mail-template-create.md +129 -0
  176. package/dist/skills/larksuite/lark-mail/references/lark-mail-template-update.md +150 -0
  177. package/dist/skills/larksuite/lark-mail/references/lark-mail-thread.md +111 -0
  178. package/dist/skills/larksuite/lark-mail/references/lark-mail-triage.md +122 -0
  179. package/dist/skills/larksuite/lark-mail/references/lark-mail-watch.md +94 -0
  180. package/dist/skills/larksuite/lark-markdown/SKILL.md +46 -0
  181. package/dist/skills/larksuite/lark-markdown/references/lark-markdown-create.md +86 -0
  182. package/dist/skills/larksuite/lark-markdown/references/lark-markdown-fetch.md +79 -0
  183. package/dist/skills/larksuite/lark-markdown/references/lark-markdown-overwrite.md +85 -0
  184. package/dist/skills/larksuite/lark-minutes/SKILL.md +139 -0
  185. package/dist/skills/larksuite/lark-minutes/references/lark-minutes-download.md +137 -0
  186. package/dist/skills/larksuite/lark-minutes/references/lark-minutes-search.md +206 -0
  187. package/dist/skills/larksuite/lark-minutes/references/lark-minutes-upload.md +104 -0
  188. package/dist/skills/larksuite/lark-okr/SKILL.md +133 -0
  189. package/dist/skills/larksuite/lark-okr/references/lark-okr-contentblock.md +359 -0
  190. package/dist/skills/larksuite/lark-okr/references/lark-okr-cycle-detail.md +84 -0
  191. package/dist/skills/larksuite/lark-okr/references/lark-okr-cycle-list.md +90 -0
  192. package/dist/skills/larksuite/lark-okr/references/lark-okr-entities.md +329 -0
  193. package/dist/skills/larksuite/lark-okr/references/lark-okr-image-upload.md +116 -0
  194. package/dist/skills/larksuite/lark-okr/references/lark-okr-progress-create.md +81 -0
  195. package/dist/skills/larksuite/lark-okr/references/lark-okr-progress-delete.md +47 -0
  196. package/dist/skills/larksuite/lark-okr/references/lark-okr-progress-get.md +62 -0
  197. package/dist/skills/larksuite/lark-okr/references/lark-okr-progress-list.md +80 -0
  198. package/dist/skills/larksuite/lark-okr/references/lark-okr-progress-update.md +81 -0
  199. package/dist/skills/larksuite/lark-openapi-explorer/SKILL.md +153 -0
  200. package/dist/skills/larksuite/lark-shared/SKILL.md +138 -0
  201. package/dist/skills/larksuite/lark-sheets/SKILL.md +345 -0
  202. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-cell-data.md +197 -0
  203. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-cell-images.md +59 -0
  204. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-cell-style-and-merge.md +141 -0
  205. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-dropdown.md +133 -0
  206. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-filter-views.md +193 -0
  207. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-float-images.md +125 -0
  208. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-formula.md +88 -0
  209. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-row-column-management.md +151 -0
  210. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-sheet-management.md +164 -0
  211. package/dist/skills/larksuite/lark-sheets/references/lark-sheets-spreadsheet-management.md +134 -0
  212. package/dist/skills/larksuite/lark-skill-maker/SKILL.md +85 -0
  213. package/dist/skills/larksuite/lark-slides/SKILL.md +525 -0
  214. package/dist/skills/larksuite/lark-slides/assets/templates/administration--all_hands_meeting.xml +1999 -0
  215. package/dist/skills/larksuite/lark-slides/assets/templates/administration--annual_gala.xml +1160 -0
  216. package/dist/skills/larksuite/lark-slides/assets/templates/administration--company_intro.xml +1376 -0
  217. package/dist/skills/larksuite/lark-slides/assets/templates/administration--corporate_culture.xml +1765 -0
  218. package/dist/skills/larksuite/lark-slides/assets/templates/hr--employee_training.xml +912 -0
  219. package/dist/skills/larksuite/lark-slides/assets/templates/hr--employee_training_workshop.xml +1504 -0
  220. package/dist/skills/larksuite/lark-slides/assets/templates/hr--onboarding.xml +933 -0
  221. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--brand_communication.xml +1367 -0
  222. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--brand_logo_design.xml +1347 -0
  223. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--brand_operations_plan.xml +1309 -0
  224. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--business_plan.xml +1646 -0
  225. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--marketing_plan.xml +1469 -0
  226. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--marketing_strategy.xml +1484 -0
  227. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--product_whitepaper.xml +1455 -0
  228. package/dist/skills/larksuite/lark-slides/assets/templates/marketing--roadshow_business_plan.xml +1506 -0
  229. package/dist/skills/larksuite/lark-slides/assets/templates/misc--book_sharing.xml +1338 -0
  230. package/dist/skills/larksuite/lark-slides/assets/templates/misc--club_event_plan.xml +4885 -0
  231. package/dist/skills/larksuite/lark-slides/assets/templates/misc--student_career_plan.xml +1854 -0
  232. package/dist/skills/larksuite/lark-slides/assets/templates/office--dark_general.xml +3763 -0
  233. package/dist/skills/larksuite/lark-slides/assets/templates/office--dept_annual_report.xml +1192 -0
  234. package/dist/skills/larksuite/lark-slides/assets/templates/office--light_general.xml +3378 -0
  235. package/dist/skills/larksuite/lark-slides/assets/templates/office--project_kickoff.xml +3152 -0
  236. package/dist/skills/larksuite/lark-slides/assets/templates/office--quarterly_review.xml +1253 -0
  237. package/dist/skills/larksuite/lark-slides/assets/templates/office--work_report.xml +1099 -0
  238. package/dist/skills/larksuite/lark-slides/assets/templates/office--work_summary.xml +4420 -0
  239. package/dist/skills/larksuite/lark-slides/assets/templates/office--work_summary_report.xml +1523 -0
  240. package/dist/skills/larksuite/lark-slides/assets/templates/operations--brand_logo_design.xml +1347 -0
  241. package/dist/skills/larksuite/lark-slides/assets/templates/operations--brand_operations_plan.xml +1309 -0
  242. package/dist/skills/larksuite/lark-slides/assets/templates/operations--marketing_plan.xml +1469 -0
  243. package/dist/skills/larksuite/lark-slides/assets/templates/operations--product_promotion.xml +687 -0
  244. package/dist/skills/larksuite/lark-slides/assets/templates/personal--experience_sharing.xml +2242 -0
  245. package/dist/skills/larksuite/lark-slides/assets/templates/personal--personal_resume.xml +2047 -0
  246. package/dist/skills/larksuite/lark-slides/assets/templates/personal--promotion_defense.xml +1099 -0
  247. package/dist/skills/larksuite/lark-slides/assets/templates/personal--promotion_report.xml +1039 -0
  248. package/dist/skills/larksuite/lark-slides/assets/templates/personal--self_intro.xml +696 -0
  249. package/dist/skills/larksuite/lark-slides/assets/templates/personal--teaching_sharing.xml +3013 -0
  250. package/dist/skills/larksuite/lark-slides/assets/templates/product--business_case_analysis.xml +1341 -0
  251. package/dist/skills/larksuite/lark-slides/assets/templates/product--market_analysis.xml +898 -0
  252. package/dist/skills/larksuite/lark-slides/assets/templates/product--product_analysis.xml +1537 -0
  253. package/dist/skills/larksuite/lark-slides/assets/templates/product--product_intro.xml +2838 -0
  254. package/dist/skills/larksuite/lark-slides/assets/templates/product--product_promotion.xml +687 -0
  255. package/dist/skills/larksuite/lark-slides/assets/templates/product--product_promotion_2.xml +687 -0
  256. package/dist/skills/larksuite/lark-slides/references/examples.md +261 -0
  257. package/dist/skills/larksuite/lark-slides/references/lark-slides-create.md +137 -0
  258. package/dist/skills/larksuite/lark-slides/references/lark-slides-edit-workflows.md +142 -0
  259. package/dist/skills/larksuite/lark-slides/references/lark-slides-media-upload.md +128 -0
  260. package/dist/skills/larksuite/lark-slides/references/lark-slides-replace-slide.md +239 -0
  261. package/dist/skills/larksuite/lark-slides/references/lark-slides-xml-presentation-slide-create.md +221 -0
  262. package/dist/skills/larksuite/lark-slides/references/lark-slides-xml-presentation-slide-delete.md +123 -0
  263. package/dist/skills/larksuite/lark-slides/references/lark-slides-xml-presentation-slide-get.md +110 -0
  264. package/dist/skills/larksuite/lark-slides/references/lark-slides-xml-presentation-slide-replace.md +186 -0
  265. package/dist/skills/larksuite/lark-slides/references/lark-slides-xml-presentations-get.md +98 -0
  266. package/dist/skills/larksuite/lark-slides/references/slide-templates.md +201 -0
  267. package/dist/skills/larksuite/lark-slides/references/slides_demo.xml +226 -0
  268. package/dist/skills/larksuite/lark-slides/references/slides_xml_schema_definition.xml +3004 -0
  269. package/dist/skills/larksuite/lark-slides/references/template-catalog.md +464 -0
  270. package/dist/skills/larksuite/lark-slides/references/template-index.json +1853 -0
  271. package/dist/skills/larksuite/lark-slides/references/xml-format-guide.md +369 -0
  272. package/dist/skills/larksuite/lark-slides/references/xml-schema-quick-ref.md +215 -0
  273. package/dist/skills/larksuite/lark-slides/scripts/layout_lint.py +349 -0
  274. package/dist/skills/larksuite/lark-slides/scripts/layout_lint_test.py +159 -0
  275. package/dist/skills/larksuite/lark-slides/scripts/template_tool.py +970 -0
  276. package/dist/skills/larksuite/lark-slides/scripts/template_tool_test.py +177 -0
  277. package/dist/skills/larksuite/lark-task/SKILL.md +165 -0
  278. package/dist/skills/larksuite/lark-task/references/lark-task-assign.md +38 -0
  279. package/dist/skills/larksuite/lark-task/references/lark-task-comment.md +28 -0
  280. package/dist/skills/larksuite/lark-task/references/lark-task-complete.md +27 -0
  281. package/dist/skills/larksuite/lark-task/references/lark-task-create.md +57 -0
  282. package/dist/skills/larksuite/lark-task/references/lark-task-followers.md +35 -0
  283. package/dist/skills/larksuite/lark-task/references/lark-task-get-my-tasks.md +55 -0
  284. package/dist/skills/larksuite/lark-task/references/lark-task-get-related-tasks.md +53 -0
  285. package/dist/skills/larksuite/lark-task/references/lark-task-reminder.md +36 -0
  286. package/dist/skills/larksuite/lark-task/references/lark-task-reopen.md +27 -0
  287. package/dist/skills/larksuite/lark-task/references/lark-task-search.md +41 -0
  288. package/dist/skills/larksuite/lark-task/references/lark-task-set-ancestor.md +32 -0
  289. package/dist/skills/larksuite/lark-task/references/lark-task-subscribe-event.md +86 -0
  290. package/dist/skills/larksuite/lark-task/references/lark-task-tasklist-create.md +35 -0
  291. package/dist/skills/larksuite/lark-task/references/lark-task-tasklist-members.md +36 -0
  292. package/dist/skills/larksuite/lark-task/references/lark-task-tasklist-search.md +38 -0
  293. package/dist/skills/larksuite/lark-task/references/lark-task-tasklist-task-add.md +38 -0
  294. package/dist/skills/larksuite/lark-task/references/lark-task-update.md +37 -0
  295. package/dist/skills/larksuite/lark-task/references/lark-task-upload-attachment.md +59 -0
  296. package/dist/skills/larksuite/lark-vc/SKILL.md +168 -0
  297. package/dist/skills/larksuite/lark-vc/references/lark-vc-notes.md +126 -0
  298. package/dist/skills/larksuite/lark-vc/references/lark-vc-recording.md +153 -0
  299. package/dist/skills/larksuite/lark-vc/references/lark-vc-search.md +176 -0
  300. package/dist/skills/larksuite/lark-vc-agent/SKILL.md +121 -0
  301. package/dist/skills/larksuite/lark-vc-agent/references/lark-vc-agent-meeting-events.md +247 -0
  302. package/dist/skills/larksuite/lark-vc-agent/references/lark-vc-agent-meeting-join.md +133 -0
  303. package/dist/skills/larksuite/lark-vc-agent/references/lark-vc-agent-meeting-leave.md +111 -0
  304. package/dist/skills/larksuite/lark-whiteboard/SKILL.md +144 -0
  305. package/dist/skills/larksuite/lark-whiteboard/references/connectors.md +102 -0
  306. package/dist/skills/larksuite/lark-whiteboard/references/content.md +40 -0
  307. package/dist/skills/larksuite/lark-whiteboard/references/image.md +80 -0
  308. package/dist/skills/larksuite/lark-whiteboard/references/lark-whiteboard-query.md +49 -0
  309. package/dist/skills/larksuite/lark-whiteboard/references/lark-whiteboard-update.md +100 -0
  310. package/dist/skills/larksuite/lark-whiteboard/references/layout.md +374 -0
  311. package/dist/skills/larksuite/lark-whiteboard/references/schema.md +357 -0
  312. package/dist/skills/larksuite/lark-whiteboard/references/style.md +318 -0
  313. package/dist/skills/larksuite/lark-whiteboard/references/typography.md +73 -0
  314. package/dist/skills/larksuite/lark-whiteboard/routes/dsl.md +107 -0
  315. package/dist/skills/larksuite/lark-whiteboard/routes/mermaid.md +27 -0
  316. package/dist/skills/larksuite/lark-whiteboard/routes/svg.md +54 -0
  317. package/dist/skills/larksuite/lark-whiteboard/scenes/architecture.md +433 -0
  318. package/dist/skills/larksuite/lark-whiteboard/scenes/bar-chart.md +187 -0
  319. package/dist/skills/larksuite/lark-whiteboard/scenes/comparison.md +135 -0
  320. package/dist/skills/larksuite/lark-whiteboard/scenes/fishbone.md +238 -0
  321. package/dist/skills/larksuite/lark-whiteboard/scenes/flowchart.md +185 -0
  322. package/dist/skills/larksuite/lark-whiteboard/scenes/flywheel.md +195 -0
  323. package/dist/skills/larksuite/lark-whiteboard/scenes/funnel.md +101 -0
  324. package/dist/skills/larksuite/lark-whiteboard/scenes/line-chart.md +214 -0
  325. package/dist/skills/larksuite/lark-whiteboard/scenes/mermaid.md +130 -0
  326. package/dist/skills/larksuite/lark-whiteboard/scenes/milestone.md +139 -0
  327. package/dist/skills/larksuite/lark-whiteboard/scenes/organization.md +173 -0
  328. package/dist/skills/larksuite/lark-whiteboard/scenes/photo-showcase.md +126 -0
  329. package/dist/skills/larksuite/lark-whiteboard/scenes/pyramid.md +99 -0
  330. package/dist/skills/larksuite/lark-whiteboard/scenes/swimlane.md +371 -0
  331. package/dist/skills/larksuite/lark-whiteboard/scenes/treemap.md +216 -0
  332. package/dist/skills/larksuite/lark-wiki/SKILL.md +111 -0
  333. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-delete-space.md +205 -0
  334. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-move.md +183 -0
  335. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-node-copy.md +72 -0
  336. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-node-create.md +127 -0
  337. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-node-list.md +88 -0
  338. package/dist/skills/larksuite/lark-wiki/references/lark-wiki-space-list.md +68 -0
  339. package/dist/skills/larksuite/lark-workflow-meeting-summary/SKILL.md +104 -0
  340. package/dist/skills/larksuite/lark-workflow-standup-report/SKILL.md +120 -0
  341. package/package.json +2 -1
@@ -0,0 +1,735 @@
1
+ # Base Formula Writing Guide
2
+
3
+ ## Mandatory Read Acknowledgement
4
+
5
+ When creating or updating a formula field with `lark-cli base +field-create/+field-update --json ...` and `type` is `formula`, you should read this guide first and only then add `--i-have-read-guide` to the command.
6
+
7
+ Do **not** proactively add `--i-have-read-guide` before reading this guide. Without it, the CLI will fail fast and direct you back to this guide.
8
+
9
+ ## Default strategy
10
+
11
+ **All cross-table references, aggregations, and computed fields should use Formula fields by default.** Do NOT use Lookup fields unless the user explicitly requests it. Formula is a strict superset of Lookup — anything Lookup can do, Formula can do with a single expression.
12
+
13
+ ## Usage
14
+
15
+ When creating a formula field, the Agent should:
16
+
17
+ 1. Get all table names: `lark-cli base +table-list --base-token <base>` — returns `items[].table_name`
18
+ 2. Get table structure: `lark-cli base +table-get --base-token <base> --table-id <table>` — returns `fields[]`
19
+ 3. If the formula references other tables, also get those tables' structures
20
+ 4. Write the formula expression following this guide
21
+ 5. Construct the Formula field JSON and submit it to create or update the field
22
+
23
+ **Key constraints**:
24
+
25
+ - The JSON must include `"type": "formula"` — this field is required
26
+ - Table names and field names in the formula must **exactly match** those returned by `+table-list` / `+table-get`
27
+ - The `expression` value is a string containing the formula expression; double quotes inside the expression must be properly escaped in JSON (e.g. `\"text\"`)
28
+
29
+ ---
30
+
31
+ ## Section 1: Core Concepts — Scalar vs List
32
+
33
+ This is the foundation of formula logic. You must determine this before writing any formula.
34
+
35
+ | Syntax | Meaning | Return type | Example |
36
+ | --------------------- | -------------------------------------------- | ---------------------- | -------------------------------------------- |
37
+ | `[Field]` | Value of this field in the current row | Scalar (single value) | `[Name]` → `"Alice"` |
38
+ | `[TableName].[Field]` | All values of this field in the target table | List (multiple values) | `[Employees].[Name]` → `["Alice","Bob",...]` |
39
+ | `[TableName]` | The target table (entire table) | Table reference | Used as data range for FILTER/COUNTIF etc. |
40
+
41
+ **Rules**:
42
+
43
+ - Scalars can be used directly in operations: `[Price] * [Quantity]`
44
+ - Lists cannot be used as scalars — they must be processed first: use `SUM()` for sum, `ARRAYJOIN(",")` for joining, `FIRST()`/`LAST()`/`NTH()` for single value extraction
45
+ - Link field access `[LinkField].[TargetField]` returns a list (values of the target field for all linked records)
46
+ - **LISTCOMBINE flattening rule**: When a FILTER's result column is itself a multi-value field (`select` with `multiple=true`, `link`, etc.), it produces a 2D array and **must** be flattened with `.LISTCOMBINE()`; for single-value fields (`number`, `text`, etc.) it can be omitted, but adding it is never wrong:
47
+
48
+ ```
49
+ [Table].FILTER(CurrentValue.[Field] = [Value]).[Tags].LISTCOMBINE() ← required for multi-value columns
50
+ [Table].FILTER(CurrentValue.[Field] = [Value]).[NumberCol].LISTCOMBINE() ← optional for single-value columns
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Section 2: Data Types and Type Conversion
56
+
57
+ ### Field storage types
58
+
59
+ | Type | Description | Supported operations |
60
+ |------|-------------|----------------------|
61
+ | `number` | Stored as numeric value | Math operations, comparisons, auto-converts to string for concatenation |
62
+ | `text` | Stored as string | String operations; can participate in math if content is numeric, otherwise errors |
63
+ | `datetime` | Date object | Date functions, add/subtract with numbers; auto-converts to default format string when using `&` — use TEXT to format first for controlled output |
64
+ | `select` (`multiple=true`) | Data list | List functions, CONTAIN checks |
65
+ | `link` | Links to other table records | Chained access `[LinkField].[Field]`, result is a list |
66
+ | `checkbox` | TRUE/FALSE | Logical operations; auto-converts to number when compared with numbers |
67
+
68
+ ### Implicit type conversion
69
+
70
+ | Scenario | Conversion rule |
71
+ | ---------------------------- | ----------------------------------------------------------------------------------------------------------- |
72
+ | Number + Float | → Float |
73
+ | Date + Number | → Date (adds/subtracts days). Use `+`/`-` for whole days, use `DURATION()` for hour/minute/second precision |
74
+ | Date - Date | → Duration |
75
+ | Boolean compared with Number | Boolean auto-converts to number (TRUE=1, FALSE=0) |
76
+ | `&` concatenation | Both sides auto-convert to string |
77
+
78
+ ### Type consistency in comparisons
79
+
80
+ When using comparison operators (`>`, `>=`, `<`, `<=`, `=`, `!=`), **both sides should be the same type** to avoid semantic errors or unexpected results.
81
+
82
+ **Principle**: When types differ, explicitly convert one side rather than relying on implicit conversion:
83
+
84
+ - `number` vs `text` → use `VALUE()` to convert text to number
85
+ - `datetime` vs `text` → use `TEXT()` to convert date to text
86
+ - `datetime` vs `datetime` equality → dates include time components, so direct `=` comparison may fail due to different hours/minutes/seconds. For day-level equality, convert to text first: `TEXT([DateA], "YYYY/MM/DD") = TEXT([DateB], "YYYY/MM/DD")`
87
+ - `select` and `user` fields can be compared with both same-type values and text
88
+ - `text` fields in numeric aggregation (SUM/AVERAGE/MIN/MAX etc.) → convert to number with `VALUE()` first. For FILTER results, use `.MAP(VALUE(CurrentValue)).SUM()`
89
+
90
+ ---
91
+
92
+ ## Section 3: CurrentValue
93
+
94
+ **CurrentValue is the iteration variable in FILTER/MAP/COUNTIF/SUMIF functions, representing the "current item" being processed in the data range.**
95
+
96
+ ### CurrentValue meaning in different contexts
97
+
98
+ | Data range type | CurrentValue represents | Access pattern | Example |
99
+ | ---------------------------- | ----------------------- | --------------------------- | --------------------------------------------------------- |
100
+ | Entire table `[TableName]` | A row in the table | `CurrentValue.[FieldName]` | `[Orders].FILTER(CurrentValue.[Amount] > 100).[Customer]` |
101
+ | Column `[TableName].[Field]` | A single field value | Use `CurrentValue` directly | `[Orders].[Amount].FILTER(CurrentValue > 100)` |
102
+ | `select` (`multiple=true`) field `[Tags]` | One option | Use `CurrentValue` directly | `[Tags].FILTER(CurrentValue = "Important")` |
103
+ | LIST-generated list | One element | Use `CurrentValue` directly | `LIST(1,2,3).MAP(CurrentValue * 2)` |
104
+
105
+ ### Key rules
106
+
107
+ 1. **When data range is a table**, use `CurrentValue.[FieldName]` to access row fields
108
+ 2. **When data range is a column/list**, use `CurrentValue` directly for the element value — **cannot** use `CurrentValue.[FieldName]`
109
+ 3. CurrentValue can **only** appear inside the condition/mapping parameters of FILTER/MAP/COUNTIF/SUMIF functions
110
+ 4. To reference the current table's field value in a condition, write `[FieldName]` directly — it refers to the formula row's value, not a property of CurrentValue
111
+
112
+ ### Anti-patterns
113
+
114
+ | Wrong | Reason | Correct |
115
+ | ---------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------ |
116
+ | `[Table].[Col].FILTER(CurrentValue.[Col] > 0)` | Data range is a column; CurrentValue is a scalar, cannot use `.` to access fields | `[Table].[Col].FILTER(CurrentValue > 0)` |
117
+ | `[Table].FILTER(CurrentValue > 100)` | Data range is a table; CurrentValue is a row, cannot compare directly | `[Table].FILTER(CurrentValue.[Amount] > 100).[Amount]` |
118
+ | `CurrentValue + 1` (at top level) | CurrentValue can only be used inside iteration functions | Use inside MAP/FILTER etc. |
119
+
120
+ ---
121
+
122
+ ## Section 4: Operators
123
+
124
+ Base formulas **only allow** the following operators. `like`, `in`, `<>`, `**`, `^` etc. are prohibited.
125
+
126
+ | Category | Operators | Description |
127
+ | ------------- | -------------------------- | -------------------------------------------------------------------------- |
128
+ | Arithmetic | `+` `-` `*` `/` `%` | Add, subtract, multiply, divide, modulo (`%` is equivalent to `MOD()`) |
129
+ | Comparison | `>` `>=` `<` `<=` `=` `!=` | Greater than, greater or equal, less than, less or equal, equal, not equal |
130
+ | Logical | `&&` `\|\|` | AND, OR |
131
+ | Concatenation | `&` | Text concatenation; non-text values auto-convert to string |
132
+
133
+ **Important**:
134
+
135
+ - Equality uses `=` (single equals), not `==`
136
+ - Not-equal uses `!=`, not `<>`
137
+ - String concatenation uses `&`, not `+`
138
+ - Both `&&`/`||` and AND()/OR() functions are supported
139
+
140
+ ---
141
+
142
+ ## Section 5: Link Fields and Cross-Table References
143
+
144
+ ### Link field description
145
+
146
+ When a field type is described as `FieldName: Link [target table: X, foreign key: Y]`, it links to target table X using field Y as the join key.
147
+
148
+ ### Chained cross-table access
149
+
150
+ ```
151
+ [LinkField].[TargetField]
152
+ ```
153
+
154
+ Retrieves the target field values for all linked records as a list. Supports continued chaining: `[LinkA].[LinkB].[Field]`.
155
+
156
+ ### Equivalent expanded form
157
+
158
+ - Multi-value link: `[TargetTableX].FILTER([LinkField].CONTAIN(CurrentValue.[Y])).[TargetField].LISTCOMBINE()`
159
+ - Single-value link: `[TargetTableX].FILTER(CurrentValue.[Y] = [LinkField]).[TargetField].LISTCOMBINE()`
160
+
161
+ (`.LISTCOMBINE()` is required when `[TargetField]` is a multi-value field; optional for single-value fields)
162
+
163
+ ### Notes
164
+
165
+ - Link fields typically return **lists** (possibly empty)
166
+ - To output a single value, use aggregation (SUM/MAX), joining (ARRAYJOIN), or extraction (FIRST/LAST/NTH)
167
+ - Do not nest FILTER inside FILTER for cross-table queries — prefer link field chained access
168
+
169
+ ---
170
+
171
+ ## Section 6: Function Call Conventions
172
+
173
+ ### Two calling styles
174
+
175
+ | Style | Format | Description |
176
+ | ---------- | ------------------ | ----------------------------------- |
177
+ | Functional | `FUNC(arg1, arg2)` | Works for all functions |
178
+ | Chained | `arg1.FUNC(arg2)` | Moves the first argument before `.` |
179
+
180
+ **Rules**:
181
+
182
+ - Zero-argument functions cannot be chained: `NOW()`, `TODAY()`, `PI()`, `TRUE()`, `FALSE()`
183
+ - SORTBY can **only** be chained: `[Table].SORTBY([Table].[SortCol]).[OutputCol]`. The sort column always uses the original table's column name (`[TableName].[Field]` format); the engine aligns rows internally, even when the data range is a FILTER result
184
+ - FILTER is recommended to be chained: `[Table].FILTER(condition).[OutputCol]`
185
+
186
+ ### FILTER / SORTBY result column rules
187
+
188
+ - **When data range is a table** `[TableName]`, FILTER / SORTBY returns a table reference. The chain **must** end with `.[Field]` to specify the result column, otherwise the formula fails:
189
+
190
+ ```
191
+ Correct: [Sales].FILTER(CurrentValue.[Amount] > 100).[Customer]
192
+ Correct: [Sales].FILTER(condition).SORTBY([Sales].[SortCol]).[Customer] ← result column at end of chain
193
+ Wrong: [Sales].FILTER(CurrentValue.[Amount] > 100) ← missing result column
194
+ ```
195
+
196
+ - **When data range is a column** `[TableName].[Field]` or a list, FILTER returns the filtered list directly — **no** result column needed:
197
+
198
+ ```
199
+ Correct: [Sales].[Amount].FILTER(CurrentValue > 100)
200
+ ```
201
+
202
+ After the result column, it's recommended to flatten with `.LISTCOMBINE()` first (especially when the result column is a multi-value field), then chain aggregation functions:
203
+
204
+ ```
205
+ [Sales].FILTER(CurrentValue.[Amount] > 100).[Amount].LISTCOMBINE().SUM()
206
+ ```
207
+
208
+ ---
209
+
210
+ ## Section 7: Hard Constraints
211
+
212
+ 1. **Nesting prohibition**: FILTER / SUMIF / COUNTIF / MAP **must not be nested** inside each other's condition/mapping expressions. None of these functions can appear inside the condition or mapping parameter of another.
213
+ - Prohibited: `[Table1].FILTER(CurrentValue.[Col] = [Table2].FILTER(...).[Col])` ← FILTER inside FILTER condition
214
+ - Prohibited: `[Table].MAP([Table2].MAP(...))` ← MAP inside MAP mapping
215
+ - **Allowed**: `[Table].FILTER(cond1).[Col].FILTER(cond2)` ← chained call; the first FILTER's output is the second's data range, not nesting
216
+
217
+ 2. **Function whitelist**: Only use functions listed in Section 8. No unlisted functions.
218
+
219
+ 3. **Exact name matching**: Table names and field names in formulas must **exactly match** those returned by `+table-get` — no renaming or adding spaces.
220
+
221
+ 4. **Operator whitelist**: Only use operators listed in Section 4.
222
+
223
+ 5. **Strings use double quotes**: Strings must be wrapped in double quotes `"`, single quotes are not supported.
224
+
225
+ 6. **Do not use LOOKUP**: FILTER is a superset of LOOKUP. All LOOKUP formulas can be rewritten with FILTER. Use FILTER exclusively to reduce complexity.
226
+
227
+ ---
228
+
229
+ ## Section 8: Complete Function Reference
230
+
231
+ ### 8.1 Logic functions
232
+
233
+ | Function | Signature | Return type | Description |
234
+ | ------------- | ------------------------------------------------------------------ | -------------------- | -------------------------------------------------------------------------------------------- |
235
+ | IF | `IF(condition, true_val, [false_val])` | Matches branch type | Returns true_val when TRUE, false_val otherwise; omitting false_val returns false (not null) |
236
+ | IFS | `IFS(cond1, val1, cond2, val2, ...)` | Matches branch type | Multi-condition branching; returns value for the first TRUE condition |
237
+ | SWITCH | `SWITCH(expr, match1, result1, [match2, result2, ...], [default])` | Matches branch type | Matches expression value and returns corresponding result |
238
+ | IFERROR | `IFERROR(expr, fallback)` | Matches branch type | Returns fallback when expression errors |
239
+ | IFBLANK | `IFBLANK(expr, fallback)` | Matches branch type | Returns fallback when expression is blank (blank = NULL/empty string/empty list) |
240
+ | AND | `AND(cond1, cond2, ...)` | Boolean | TRUE when all conditions are TRUE |
241
+ | OR | `OR(cond1, cond2, ...)` | Boolean | TRUE when any condition is TRUE |
242
+ | NOT | `NOT(condition)` | Boolean | Logical negation |
243
+ | ISBLANK | `ISBLANK(value)` | Boolean | Tests if blank (NULL/empty string/empty list are blank; 0 and FALSE are not) |
244
+ | ISNULL | `ISNULL(value)` | Boolean | Tests if NULL (only NULL is true; empty string is not) |
245
+ | ISERROR | `ISERROR(expr)` | Boolean | Tests if expression errors |
246
+ | ISNUMBER | `ISNUMBER(value)` | Boolean | Tests if value is a number |
247
+ | CONTAIN | `CONTAIN(search_range, value, ...)` | Boolean | Tests if a list or `select` (`multiple=true`) contains the value; **does NOT do text substring matching** |
248
+ | CONTAINSALL | `CONTAINSALL(search_range, value, ...)` | Boolean | Tests if a list or `select` (`multiple=true`) contains all specified values |
249
+ | CONTAINSONLY | `CONTAINSONLY(search_range, value, ...)` | Boolean | Tests if a list or `select` (`multiple=true`) contains only the specified values |
250
+ | TRUE | `TRUE()` | Boolean | Returns TRUE |
251
+ | FALSE | `FALSE()` | Boolean | Returns FALSE |
252
+ | RECORD_ID | `RECORD_ID()` | Text | Returns the current row's record ID |
253
+ | RANDOMBETWEEN | `RANDOMBETWEEN(min_int, max_int, [keep_updating])` | Number | Random integer in the specified range |
254
+ | RANDOMITEM | `RANDOMITEM(list, [keep_updating])` | Matches element type | Randomly picks one element from a list |
255
+
256
+ ### 8.2 Numeric functions
257
+
258
+ | Function | Signature | Return type | Description |
259
+ | --- | --- | --- | --- |
260
+ | SUM | `SUM(val1, val2, ...)` | Number | Sum; accepts multiple values or a list |
261
+ | AVERAGE | `AVERAGE(val1, val2, ...)` | Number | Average |
262
+ | MAX | `MAX(val1, val2, ...)` | Number | Maximum |
263
+ | MIN | `MIN(val1, val2, ...)` | Number | Minimum |
264
+ | MEDIAN | `MEDIAN(val1, val2, ...)` | Number | Median |
265
+ | COUNTA | `COUNTA(val1, val2, ...)` | Number | Count of non-blank values |
266
+ | COUNTIF | `COUNTIF(data_range, condition)` | Number | Count matching items. Data range can be a **table** (CurrentValue is a row, use `CurrentValue.[Field]`) or a **column** (CurrentValue is a scalar value) |
267
+ | SUMIF | `SUMIF(data_range, condition)` | Number | Sum matching values. Data range **must be a numeric column** (e.g. `[Table].[NumField]`); CurrentValue is each value in that column (scalar), cannot use `CurrentValue.[Field]` to access other fields. For cross-field conditions, use FILTER+SUM instead |
268
+ | ROUND | `ROUND(number, digits)` | Number | Round. digits: 1=one decimal, 0=integer, -1=tens place |
269
+ | ROUNDUP | `ROUNDUP(number, digits)` | Number | Round away from zero. Same digits semantics as ROUND |
270
+ | ROUNDDOWN | `ROUNDDOWN(number, digits)` | Number | Round toward zero. Same digits semantics as ROUND |
271
+ | FLOOR | `FLOOR(number, [base])` | Number | Round down to nearest multiple of base (default 1) |
272
+ | CEILING | `CEILING(number, [base])` | Number | Round up to nearest multiple of base (default 1) |
273
+ | ABS | `ABS(number)` | Number | Absolute value |
274
+ | INT | `INT(number)` | Integer | Truncate to integer |
275
+ | MOD | `MOD(dividend, divisor)` | Number | Modulo |
276
+ | POWER | `POWER(base, exponent)` | Number | Exponentiation |
277
+ | QUOTIENT | `QUOTIENT(dividend, divisor)` | Number | Integer division |
278
+ | VALUE | `VALUE(text)` | Number | Convert text to number |
279
+ | ISODD | `ISODD(number)` | Boolean | Tests if number is odd |
280
+ | RANK | `RANK(value, search_range, [ascending])` | Number | Rank of value in range; default descending |
281
+ | SEQUENCE | `SEQUENCE(start, end, [step])` | List | Generate number sequence |
282
+ | PI | `PI()` | Number | Pi constant |
283
+ | SIN/COS/TAN/ASIN/ACOS/ATAN/ATAN2/SINH/COSH/TANH/ASINH/ACOSH/ATANH | `func(radians_or_value)` | Number | Trigonometric and hyperbolic functions; arguments in radians |
284
+
285
+ ### 8.3 Text functions
286
+
287
+ | Function | Signature | Return type | Description |
288
+ | --------------- | ---------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
289
+ | CONCATENATE | `CONCATENATE(text1, text2, ...)` | Text | Concatenate multiple texts; supports lists as input |
290
+ | LEN | `LEN(text)` | Number | Character count |
291
+ | LEFT | `LEFT(text, [count])` | Text | Extract from left; default 1 |
292
+ | RIGHT | `RIGHT(text, [count])` | Text | Extract from right; default 1 |
293
+ | MID | `MID(text, start, count)` | Text | Extract from middle |
294
+ | FIND | `FIND(search_val, search_range, [start])` | Number | Find substring position (case-sensitive); returns -1 if not found |
295
+ | REPLACE | `REPLACE(text, start, count, new_text)` | Text | Replace by position |
296
+ | SUBSTITUTE | `SUBSTITUTE(text, old_text, new_text, [occurrence])` | Text | Replace by content; can specify which occurrence |
297
+ | UPPER | `UPPER(text)` | Text | Convert to uppercase |
298
+ | LOWER | `LOWER(text)` | Text | Convert to lowercase |
299
+ | TRIM | `TRIM(text)` | Text | Remove leading/trailing spaces |
300
+ | TEXT | `TEXT(value, format)` | Text | Format output. Date formats: `"YYYY-MM-DD"`, `"YYYY/MM/DD hh:mm:ss"`; number formats: `"00"`, `"000.00"` |
301
+ | CONTAINTEXT | `CONTAINTEXT(text, search_text)` | Boolean | Tests if text contains substring (text substring matching) |
302
+ | SPLIT | `SPLIT(text, delimiter)` | List | Split text by delimiter |
303
+ | TODATE | `TODATE(value)` | Date | Convert date string to date type |
304
+ | CHAR | `CHAR(number)` | Text | ASCII code to character |
305
+ | FORMAT | `FORMAT(template, [val1, val2, ...])` | Text | Template string formatting; use `{1}`, `{2}` as placeholders |
306
+ | HYPERLINK | `HYPERLINK(url, [display_text])` | Hyperlink | Create a hyperlink |
307
+ | ENCODEURL | `ENCODEURL(text)` | Text | URL encode |
308
+ | REGEXMATCH | `REGEXMATCH(text, regex)` | Boolean | Regex match test |
309
+ | REGEXEXTRACT | `REGEXEXTRACT(text, regex)` | List | Extract first match's capture groups |
310
+ | REGEXEXTRACTALL | `REGEXEXTRACTALL(text, regex)` | 2D List | Extract all matches |
311
+ | REGEXREPLACE | `REGEXREPLACE(text, regex, replacement)` | Text | Regex replace |
312
+
313
+ ### 8.4 Date functions
314
+
315
+ | Function | Signature | Return type | Description |
316
+ | ----------- | ----------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------- |
317
+ | NOW | `NOW()` | Date | Current date and time |
318
+ | TODAY | `TODAY()` | Date | Current date (midnight) |
319
+ | DATE | `DATE(year, month, day)` | Date | Construct a date |
320
+ | YEAR | `YEAR(date)` | Number | Extract year |
321
+ | MONTH | `MONTH(date)` | Number | Extract month |
322
+ | DAY | `DAY(date)` | Number | Extract day |
323
+ | HOUR | `HOUR(date)` | Number | Extract hour |
324
+ | MINUTE | `MINUTE(date)` | Number | Extract minute |
325
+ | SECOND | `SECOND(date)` | Number | Extract second |
326
+ | WEEKDAY | `WEEKDAY(date, [type])` | Number | Day of week |
327
+ | WEEKNUM | `WEEKNUM(date, [type])` | Number | Week number |
328
+ | DAYS | `DAYS(end_date, start_date)` | Number | Days between two dates (end - start), includes decimals. **Note parameter order: end date comes first** |
329
+ | DATEDIF | `DATEDIF(start_date, end_date, [unit])` | Number | Whole days/months/years between dates. Unit: `"D"`(default)/`"M"`/`"Y"`. **Start must be before end** |
330
+ | DURATION | `DURATION(days, [hours], [minutes], [seconds])` | Duration | Create a duration for date arithmetic |
331
+ | EDATE | `EDATE(date, months)` | Date | Date N months later |
332
+ | EOMONTH | `EOMONTH(date, [months])` | Date | End of month N months later; months default 0 |
333
+ | WORKDAY | `WORKDAY(start_date, days, [holidays])` | Date | Date N workdays later (skips weekends and holidays) |
334
+ | NETWORKDAYS | `NETWORKDAYS(start_date, end_date, [holidays])` | Number | Workdays between dates (inclusive) |
335
+
336
+ ### 8.5 List functions
337
+
338
+ | Function | Signature | Return type | Description |
339
+ | --- | --- | --- | --- |
340
+ | LIST | `LIST(val1, val2, ...)` | List | Create a list |
341
+ | FIRST | `FIRST(list)` | Scalar | First element |
342
+ | LAST | `LAST(list)` | Scalar | Last element |
343
+ | NTH | `NTH(list, index)` | Scalar | Nth element (1-based) |
344
+ | FILTER | `[Table].FILTER(condition).[ResultCol]` or `[Table].[Col].FILTER(condition)` | List | Filter by condition. When data range is a table, result column is **required**; when it's a column/list, it's not needed. Use CurrentValue in conditions. Add `.LISTCOMBINE()` when result column is multi-value |
345
+ | MAP | `data_range.MAP(mapping_expr)` | List | Apply mapping to each element. Use CurrentValue in mapping |
346
+ | SORT | `SORT(list, [ascending])` | List | Sort; default ascending (TRUE) |
347
+ | SORTBY | `[Table].SORTBY([Table].[SortCol], [ascending]).[OutputCol]` | List | Sort by column then extract output column. **Chain-only, must include output column** |
348
+ | UNIQUE | `UNIQUE(list)` | List | Deduplicate |
349
+ | ARRAYJOIN | `ARRAYJOIN(list, [delimiter])` | Text | Join list elements as text; default comma-separated |
350
+ | LISTCOMBINE | `LISTCOMBINE(val1, [val2, ...])` or `list.LISTCOMBINE()` | List | Two uses: (1) merge values/lists into one list; (2) chained call to flatten 2D array (commonly used when FILTER result column is a multi-value field) |
351
+ | DISTANCE | `DISTANCE(location1, location2)` | Number | Distance between two geographic locations (km) |
352
+
353
+ ---
354
+
355
+ ## Section 9: Commonly Confused Functions
356
+
357
+ ### CONTAIN vs CONTAINTEXT
358
+
359
+ | | CONTAIN | CONTAINTEXT |
360
+ | ----------- | -------------------------------------------------------------- | ---------------------------------------------------------- |
361
+ | Purpose | Tests if a **list / `select` (`multiple=true`)** contains a value | Tests if **text** contains a substring |
362
+ | Example | `[Tags].CONTAIN("Urgent")` | `[Notes].CONTAINTEXT("completed")` |
363
+ | Wrong usage | `CONTAIN([Notes], "completed")` — cannot do substring matching | `CONTAINTEXT([Tags], "Urgent")` — Tags is a list, not text |
364
+
365
+ ### ISBLANK vs ISNULL
366
+
367
+ | | ISBLANK | ISNULL |
368
+ | ----------------- | ------- | ------ |
369
+ | NULL | TRUE | TRUE |
370
+ | `""` empty string | TRUE | FALSE |
371
+ | Empty list `[]` | TRUE | FALSE |
372
+ | `0` | FALSE | FALSE |
373
+ | `FALSE` | FALSE | FALSE |
374
+
375
+ ### DAYS vs DATEDIF
376
+
377
+ | | DAYS | DATEDIF |
378
+ | --------------- | ------------------------------------------------------------ | ----------------------------------------- |
379
+ | Parameter order | `DAYS(end, start)` — end first | `DATEDIF(start, end, unit)` — start first |
380
+ | Precision | Includes decimals (hours/minutes/seconds as fractional days) | Integer only (whole days/months/years) |
381
+ | Negative values | Returns negative when start is after end | **Errors** when start is after end |
382
+
383
+ ### SUM vs SUMIF
384
+
385
+ | | SUM | SUMIF |
386
+ | --------- | ---------------------------------------------- | -------------------------------------------------------------- |
387
+ | Purpose | Sum all values | Sum values **matching a condition** |
388
+ | Arguments | `SUM(val1, val2, ...)` or `SUM([Table].[Col])` | `SUMIF(data_range, condition)` with CurrentValue in condition |
389
+ | Example | `SUM([Orders].[Amount])` — sum all | `SUMIF([Orders].[Amount], CurrentValue > 100)` — sum only >100 |
390
+
391
+ ### FILTER+aggregation vs COUNTIF/SUMIF
392
+
393
+ | | FILTER+aggregation | COUNTIF/SUMIF |
394
+ | ----------- | ----------------------------------------------------- | ------------------------------------------------------------------------------ |
395
+ | Nature | Filter then aggregate (two steps) | One-step (syntactic sugar) |
396
+ | Equivalence | `[Table].FILTER(cond).[Col].LISTCOMBINE().SUM()` | `SUMIF([Table].[Col], cond)` (only when condition involves only column values) |
397
+ | When to use | Conditions span multiple fields, or multi-step needed | Conditions only involve column values (e.g. `CurrentValue > 100`) |
398
+
399
+ ---
400
+
401
+ ## Section 10: Decision Trees
402
+
403
+ ### Cross-table queries: which approach?
404
+
405
+ ```
406
+ Need data from another table?
407
+ ├─ Current table has a link field to the target table?
408
+ │ ├─ Yes → Use chained access: [LinkField].[TargetField]
409
+ │ │ Need aggregation? → .SUM() / .ARRAYJOIN(",") / .FIRST()
410
+ │ └─ No → Need to match by field value?
411
+ │ ├─ Field matching or complex filtering → [TargetTable].FILTER(CurrentValue.[MatchField] = [Value]).[OutputCol]
412
+ │ └─ Only counting or summing → COUNTIF([TargetTable], condition) / FILTER+SUM
413
+ ```
414
+
415
+ ### Conditional logic: IF vs IFS vs SWITCH?
416
+
417
+ ```
418
+ Need conditional logic?
419
+ ├─ Single condition → IF(condition, true_val, false_val)
420
+ ├─ Multiple mutually exclusive conditions (if-elseif-else) → IFS(cond1, val1, cond2, val2, ...)
421
+ ├─ Matching a value against fixed options → SWITCH(expr, option1, result1, option2, result2, ..., default)
422
+ └─ Need error handling?
423
+ ├─ Catch errors → IFERROR(expr, fallback)
424
+ └─ Catch blanks → IFBLANK(expr, fallback)
425
+ ```
426
+
427
+ ### Aggregation: which function?
428
+
429
+ ```
430
+ Need to aggregate data?
431
+ ├─ Sum/average/max/min for entire column → SUM/AVERAGE/MAX/MIN([Table].[Col])
432
+ ├─ Count non-blank → COUNTA([Table].[Col])
433
+ ├─ Conditional count → COUNTIF([Table], CurrentValue.[Field] = [Value])
434
+ ├─ Conditional sum (column-only condition) → SUMIF([Table].[Col], CurrentValue > threshold)
435
+ ├─ Conditional sum (cross-field condition) → [Table].FILTER(CurrentValue.[Field]=value).[NumCol].LISTCOMBINE().SUM()
436
+ ├─ Count unique → [Table].[Col].UNIQUE().COUNTA()
437
+ └─ Ranking → RANK([Value], [Table].[Col])
438
+ ```
439
+
440
+ ---
441
+
442
+ ## Section 11: Common Formula Patterns
443
+
444
+ ### Pattern 1: Cross-table conditional count
445
+
446
+ Count rows in target table matching a condition:
447
+
448
+ ```
449
+ [TargetTable].COUNTIF(CurrentValue.[MatchField] = [CurrentTableField])
450
+ ```
451
+
452
+ ### Pattern 2: Cross-table conditional sum
453
+
454
+ Filter target table by current row's value, then sum:
455
+
456
+ ```
457
+ [TargetTable].FILTER(CurrentValue.[MatchField] = [CurrentTableField]).[NumCol].LISTCOMBINE().SUM()
458
+ ```
459
+
460
+ SUMIF works when data range is a column and conditions only involve column values:
461
+
462
+ ```
463
+ SUMIF([TargetTable].[NumCol], CurrentValue > 100)
464
+ ```
465
+
466
+ Note: COUNTIF can use a table as data range (only counting, no specific column needed), but SUMIF's data range **must be a numeric column** (needs values to sum), so `CurrentValue` is each value in that column (scalar) — cannot use `CurrentValue.[OtherField]` to access other fields. For cross-field conditions, use FILTER with a table as data range.
467
+
468
+ ### Pattern 3: Cross-table lookup
469
+
470
+ ```
471
+ [TargetTable].FILTER(CurrentValue.[MatchCol] = [CurrentTableField]).[ReturnCol]
472
+ ```
473
+
474
+ ### Pattern 4: Link field values + aggregation
475
+
476
+ ```
477
+ SUM([LinkField].[NumField])
478
+ [LinkField].[TextField].UNIQUE().ARRAYJOIN(",")
479
+ ```
480
+
481
+ ### Pattern 5: Conditional text concatenation
482
+
483
+ ```
484
+ IF([Condition], "prefix" & [Field] & "suffix", "default text")
485
+ ```
486
+
487
+ ### Pattern 6: Date difference
488
+
489
+ ```
490
+ DATEDIF([StartDate], [EndDate], "D") & " days"
491
+ DAYS([EndDate], [StartDate])
492
+ ```
493
+
494
+ ### Pattern 7: List element mapping
495
+
496
+ ```
497
+ [SelectField(which multiple=true)].MAP(CurrentValue & " tag")
498
+ SPLIT([TextField], ",").MAP(TRIM(CurrentValue))
499
+ ```
500
+
501
+ ### Pattern 8: Cross-table with sorting
502
+
503
+ ```
504
+ [TargetTable].SORTBY([TargetTable].[SortCol], FALSE).[OutputCol]
505
+ [TargetTable].FILTER(CurrentValue.[Field] = [Value]).SORTBY([TargetTable].[SortCol]).[OutputCol]
506
+ ```
507
+
508
+ ---
509
+
510
+ ## Section 12: Anti-Pattern Collection
511
+
512
+ ### Mistake 1: Extra argument in MAP
513
+
514
+ ```
515
+ Wrong: [Table].[Col].MAP([Table2].[Col], CurrentValue + 1)
516
+ Correct: [Table].[Col].MAP(CurrentValue + 1)
517
+ ```
518
+
519
+ Reason: MAP takes only two arguments (data range + mapping expression), no "lookup range".
520
+
521
+ ### Mistake 2: Inverted FILTER syntax
522
+
523
+ ```
524
+ Wrong: condition.[Table].FILTER()
525
+ Correct: [Table].FILTER(condition).[ResultCol] (result column required when data range is a table)
526
+ ```
527
+
528
+ Reason: FILTER's data range comes first, condition is passed as the argument.
529
+
530
+ ### Mistake 3: Using CurrentValue.[Field] on a column range
531
+
532
+ ```
533
+ Wrong: SUMIF([Sales].[Revenue], CurrentValue.[Salesperson] = [Name])
534
+ Correct: [Sales].FILTER(CurrentValue.[Salesperson] = [Name]).[Revenue].LISTCOMBINE().SUM()
535
+ ```
536
+
537
+ Reason: `SUMIF([Sales].[Revenue], ...)` uses "Revenue" column as data range. CurrentValue is each revenue value (scalar), not a row — cannot use `.` to access other fields. Use FILTER with the table as data range for cross-field conditions.
538
+
539
+ ### Mistake 4: Missing result column after FILTER
540
+
541
+ ```
542
+ Wrong: [Sales].FILTER(CurrentValue.[Amount] > 100)
543
+ Correct: [Sales].FILTER(CurrentValue.[Amount] > 100).[Customer]
544
+ ```
545
+
546
+ Reason: FILTER on a table returns a table reference; must specify result column with `.[Field]` at the end.
547
+
548
+ ### Mistake 5: Nested FILTER
549
+
550
+ ```
551
+ Wrong: [Table1].FILTER(CurrentValue.[ID] = [Table2].FILTER(CurrentValue.[Status]="Done").[ID])
552
+ Correct: [Table1].FILTER(CurrentValue.[ID] = [CurrentRowField]).[OutputCol]
553
+ ```
554
+
555
+ Reason: FILTER/MAP/SUMIF/COUNTIF cannot be nested inside each other's conditions. Split into multiple steps or use link fields.
556
+
557
+ ### Mistake 6: SORTBY without output column
558
+
559
+ ```
560
+ Wrong: [Table].SORTBY([Table].[Col])
561
+ Correct: [Table].SORTBY([Table].[Col]).[OutputCol]
562
+ ```
563
+
564
+ Reason: SORTBY must have an output column at the end; otherwise the result cannot be represented as an array.
565
+
566
+ ### Mistake 7: SORTBY sort column without table name
567
+
568
+ ```
569
+ Wrong: [Table].SORTBY([Col]).[OutputCol]
570
+ Correct: [Table].SORTBY([Table].[Col]).[OutputCol]
571
+ ```
572
+
573
+ Reason: SORTBY's sort column must use `[TableName].[FieldName]` format.
574
+
575
+ ### Mistake 8: Using CONTAIN for text substring matching
576
+
577
+ ```
578
+ Wrong: CONTAIN([Notes], "urgent")
579
+ Correct: CONTAINTEXT([Notes], "urgent")
580
+ ```
581
+
582
+ Reason: CONTAIN checks if a list or `select` (`multiple=true`) contains a whole value, not substring matching. Use CONTAINTEXT for text substrings.
583
+
584
+ ### Mistake 9: Date concatenation without formatting
585
+
586
+ ```
587
+ Not recommended: "Deadline: " & [DateField] ← output format is uncontrolled
588
+ Recommended: "Deadline: " & TEXT([DateField], "YYYY-MM-DD")
589
+ ```
590
+
591
+ Reason: Concatenating a date with `&` won't error, but uses the default format. Use TEXT to specify the format explicitly.
592
+
593
+ ### Mistake 10: Reversed DAYS parameter order
594
+
595
+ ```
596
+ Wrong: DAYS([StartDate], [EndDate]) → returns negative
597
+ Correct: DAYS([EndDate], [StartDate]) → returns positive
598
+ ```
599
+
600
+ Reason: DAYS parameter order is end date first, start date second.
601
+
602
+ ### Mistake 11: Chaining zero-argument functions
603
+
604
+ ```
605
+ Wrong: TODAY.DAYS([Date])
606
+ Correct: TODAY().DAYS([Date])
607
+ ```
608
+
609
+ Reason: NOW, TODAY, PI and other zero-argument functions must include parentheses.
610
+
611
+ ---
612
+
613
+ ## Section 13: Complete Examples
614
+
615
+ ### Example 1: Employee sales summary
616
+
617
+ **Table structure** (from `+table-get`):
618
+
619
+ - Employees: EmployeeID (Text), Name (Text), Department (Text)
620
+ - Sales: ContractID (Number), SalespersonID (Text), Quantity (Number), Total (Number)
621
+
622
+ **Current table**: Employees
623
+
624
+ **Requirement**: For each employee, output "Sold XX orders" if they have sales records, otherwise "No sales records".
625
+
626
+ **Formula**:
627
+
628
+ ```
629
+ IF(
630
+ [Sales].COUNTIF(CurrentValue.[SalespersonID] = [EmployeeID]) >= 1,
631
+ "Sold " & [Sales].COUNTIF(CurrentValue.[SalespersonID] = [EmployeeID]) & " orders",
632
+ "No sales records"
633
+ )
634
+ ```
635
+
636
+ **Field JSON**:
637
+
638
+ ```json
639
+ {
640
+ "type": "formula",
641
+ "name": "Sales Summary",
642
+ "expression": "IF([Sales].COUNTIF(CurrentValue.[SalespersonID] = [EmployeeID]) >= 1, \"Sold \" & [Sales].COUNTIF(CurrentValue.[SalespersonID] = [EmployeeID]) & \" orders\", \"No sales records\")"
643
+ }
644
+ ```
645
+
646
+ **Explanation**: `[Sales].COUNTIF(...)` uses the entire Sales table as data range. CurrentValue represents each row in Sales, accessing `CurrentValue.[SalespersonID]` for that row's salesperson. `[EmployeeID]` refers to the current row in the Employees table (where the formula lives).
647
+
648
+ ### Example 2: Chained cross-table access via link fields
649
+
650
+ **Table structure**:
651
+
652
+ - Orders: ID (`auto_number`), OrderItems (`link` [target: OrderItems, foreign key: ID])
653
+ - OrderItems: ID (`auto_number`), Product (`link` [target: Products, foreign key: ID])
654
+ - Products: ID (`auto_number`), ProductName (`text`)
655
+
656
+ **Current table**: Orders
657
+
658
+ **Requirement**: Deduplicate and comma-join all product names from linked order items.
659
+
660
+ **Formula**:
661
+
662
+ ```
663
+ [OrderItems].[Product].[ProductName].UNIQUE().ARRAYJOIN(",")
664
+ ```
665
+
666
+ **Field JSON**:
667
+
668
+ ```json
669
+ {
670
+ "type": "formula",
671
+ "name": "Product List",
672
+ "expression": "[OrderItems].[Product].[ProductName].UNIQUE().ARRAYJOIN(\",\")"
673
+ }
674
+ ```
675
+
676
+ **Explanation**: `[OrderItems]` gets linked order item records, `.[Product]` expands to each item's linked product, `.[ProductName]` gets all product names, `.UNIQUE()` deduplicates, `.ARRAYJOIN(",")` joins with commas.
677
+
678
+ ### Example 3: Cross-table filter + sort
679
+
680
+ **Table structure**:
681
+
682
+ - Projects: ProjectName (Text), Status (Text), Owner (Text)
683
+ - Tasks: TaskName (Text), Project (Text), Priority (Number), DueDate (Date)
684
+
685
+ **Current table**: Projects
686
+
687
+ **Requirement**: Find the highest-priority (lowest number) task name for the current project.
688
+
689
+ **Formula**:
690
+
691
+ ```
692
+ FIRST(
693
+ [Tasks].FILTER(CurrentValue.[Project] = [ProjectName]).SORTBY([Tasks].[Priority], TRUE).[TaskName]
694
+ )
695
+ ```
696
+
697
+ **Field JSON**:
698
+
699
+ ```json
700
+ {
701
+ "type": "formula",
702
+ "name": "Top Priority Task",
703
+ "expression": "FIRST([Tasks].FILTER(CurrentValue.[Project] = [ProjectName]).SORTBY([Tasks].[Priority], TRUE).[TaskName])"
704
+ }
705
+ ```
706
+
707
+ **Explanation**: `[Tasks].FILTER(CurrentValue.[Project] = [ProjectName])` filters tasks belonging to the current project. `.SORTBY([Tasks].[Priority], TRUE)` sorts by priority ascending. `.[TaskName]` extracts task names. `FIRST(...)` gets the first one (highest priority).
708
+
709
+ ---
710
+
711
+ ## Section 14: Translating User Requirements to Formulas
712
+
713
+ When the user describes their formula need in natural language, follow these rules to convert it into a precise expression:
714
+
715
+ 1. **Numbers must use precise values**: "less than 80%" → field value less than `0.8`. "above 1000" → `>= 1000`.
716
+ 2. **Interval boundaries**: "above/below/within" = closed (inclusive); "less than/more than/outside" = open (exclusive).
717
+ 3. **Branching logic** must be organized as an ordered list with a fallback branch. Each branch has a condition and output.
718
+ - Example: "return risk level for 1-3" → `IFS([Value] = 1, "low", [Value] = 2, "medium", [Value] = 3, "high")` with an `IFERROR` or trailing empty-string fallback.
719
+ 4. **Multi-level branches must be flattened** to a single level. Nested if-else chains → flat IFS.
720
+ 5. **Branch conditions must be mutually exclusive**. If the user's conditions overlap, rewrite to eliminate ambiguity.
721
+ 6. **Reorder branches by logical priority** if the user's order is illogical (e.g., check specific conditions before catch-all).
722
+
723
+ ---
724
+
725
+ ## Section 15: Constraint Summary
726
+
727
+ - Request body must include `"type": "formula"` — this field is required
728
+ - Only use functions and operators listed in this document
729
+ - FILTER/SUMIF/COUNTIF/MAP must not be nested inside each other's conditions (chained calls are not nesting)
730
+ - Do not use LOOKUP — use FILTER exclusively
731
+ - Table and field names must exactly match `+table-get` output
732
+ - Strings must use double quotes `"`
733
+ - Format dates with TEXT before concatenating, to control output format
734
+ - SORTBY can only be chained and must include an output column
735
+ - Link fields return lists — aggregate or extract single values before output