### Application Query Interface Response Example Source: https://hc.jiandaoyun.com/doc/13844 This JSON structure represents the response from the application query interface, listing available applications with their names and IDs. ```json { "apps": [ { "name": "应用名称1", "app_id": "5d5a5bbb850a6d0604ab119" }, { "name": "应用名称2", "app_id": "5d5a5c14850a6d0604ab11a4" } ] } ``` -------------------------------- ### Cartesian Product Example Calculation Source: https://hc.jiandaoyun.com/doc/11240 This example illustrates how to calculate the data volume resulting from a horizontal join to identify a Cartesian product. It shows that if the total data volume after the join is greater than twice the sum of the input table sizes, a Cartesian product is triggered. ```plaintext 横向连接后的总数据量=5*5+4*4=41 ``` ```plaintext (m+n)*2=(9+9)*2=36 ``` ```plaintext 41>36 ``` -------------------------------- ### Create Single Data Interface with Data Creator Source: https://hc.jiandaoyun.com/doc/17655 This example demonstrates how to use the `data_creator` parameter in the 'Create Single Data Interface' to specify the submitter of the data. ```APIDOC ## POST /api/v1/data/create_single ### Description Submits a single data entry to a specified application and form, with the option to designate a specific data creator. ### Method POST ### Endpoint /api/v1/data/create_single ### Parameters #### Request Body - **app_id** (string) - Required - The ID of the application. - **entry_id** (string) - Required - The ID of the form entry. - **data_creator** (string) - Optional - The username (member ID) of the data creator. - **data** (object) - Required - The data payload to be submitted, where keys are widget IDs and values are the submitted data. ### Request Example ```json { "app_id":"62df48866268a800069ce128", "entry_id":"64eeb36f0995460007a9be37", "data_creator":"jdy", "data":{ "_widget_1693300060295":{ "value":"简道云" }, "_widget_1693300060299":{ "value":"小简" }, "_widget_1693300060298":{ "value":"18861838888" } } } ``` ### Response #### Success Response (200) - **data** (object) - Contains details of the created data entry, including creator, updater, timestamps, and submitted data. - **creator** (object) - Information about the data creator. - **name** (string) - The name of the creator. - **username** (string) - The username of the creator. - **status** (integer) - The status of the creator. - **type** (integer) - The type of the creator. - **departments** (array) - List of department IDs the creator belongs to. - **updater** (object) - Information about the last updater. - **deleter** (null) - Placeholder for deleter information. - **createTime** (string) - Timestamp of creation. - **updateTime** (string) - Timestamp of last update. - **deleteTime** (null) - Placeholder for deletion timestamp. - **_id** (string) - The unique ID of the created data entry. - **appId** (string) - The ID of the application. - **entryId** (string) - The ID of the form entry. #### Response Example ```json { "data": { "creator": { "name": "夏洛", "username": "jdy", "status": 1, "type": 0, "departments": [ 159 ] }, "updater": { "name": "夏洛", "username": "jdy", "status": 1, "type": 0, "departments": [ 159 ] }, "deleter": null, "createTime": "2023-08-30T03:26:18.190Z", "updateTime": "2023-08-30T03:26:18.190Z", "deleteTime": null, "_widget_1693300060295": "简道云", "_widget_1693300060299": "小简", "_widget_1693300060298": "18861838888", "_id": "64eeb6da3218930007341745", "appId": "62df48866268a800069ce128", "entryId": "64eeb36f0995460007a9be37" } } ``` ``` -------------------------------- ### Get Approval Comments API Example Source: https://hc.jiandaoyun.com/doc/13863 This API endpoint allows for batch retrieval of approval comments for a single process form data entry. Ensure the correct app, entry, and data IDs are provided. ```http POST /api/v1/app/:appId/entry/:entryId/data/:dataId/approval_comments ``` ```json { "approveCommentList": [ { "flowNodeName": "必须填写手写签名", "flowAction": "forward", "comment": "一条审批意见", "signature_url": "https://files.jiandaoyun.com/FtMNaGofTPeLMFW5_5SCs8w2mX8h?e=1594742399&token=bM7UwVPyBBdPaleBZt21SWKzMylqPUpn-05jZlas:73YsMFXOeKHXN-XsyKm5c3Hkyp4=" } ] } ``` -------------------------------- ### Form Query Interface Response Example Source: https://hc.jiandaoyun.com/doc/13844 This JSON structure represents the response from the form query interface, detailing forms with their names, associated application IDs, and entry IDs. ```json { "forms": [ { "name": "表单名称1", "app_id": "5e0dca0cc9a2790006c11e02", "entry_id": "56fcab0f02c4675e3fe9694a" }, { "name": "表单名称2", "app_id": "5e0dca0cc9a2790006c11e02", "entry_id": "5ed750af3c07c70f9c6eef78" } ] } ``` -------------------------------- ### Generate Sequential Dates for Subform Source: https://hc.jiandaoyun.com/doc/13960 This formula generates a sequence of dates for each row in the subform, starting from the leave start date. It ensures each day within the leave period is accounted for. ```formula IF(子表单.序号=='1',请假开始时间,IF((VALUE(子表单.序号)<=子表单行数+1),DATE(YEAR(请假开始时间),MONTH(请假开始时间),DAY(请假开始时间)+VALUE(子表单.序号)-1),' ')) ``` -------------------------------- ### 表单API - 表单字段查询接口 Source: https://hc.jiandaoyun.com/doc/13927 通过表单API可以获取指定表单的字段信息,除分割线字段和关联查询字段以外。字段ID以widget为前缀,一旦添加,将不会变更。 ```APIDOC ## 表单API - 表单字段查询接口 ### Description 获取指定表单的字段信息。 ### Method POST ### Endpoint https://www.jiandaoyun.com/api/v1/form/field/query ### Parameters #### Request Body - **appId** (string) - Required - 应用ID - **formId** (string) - Required - 表单ID ``` -------------------------------- ### 设置辅助字段默认值 Source: https://hc.jiandaoyun.com/doc/14086 使用 CONCATENATE 函数将领取时间和微信 OpenID 拼接起来,作为辅助字段的默认值。此字段应设置为不可见且始终重新计算。 ```Formula CONCATENATE(领取时间,微信OpenID) ``` -------------------------------- ### Form Field: TEXT Function for Date to Weekday Source: https://hc.jiandaoyun.com/doc/15486 Use the TEXT function with the 'EEE' format specifier to get the abbreviated day of the week from a date field in a form. ```formula TEXT(DATE(日期字段),"EEE") ``` -------------------------------- ### 数据API - 查询单条数据接口 Source: https://hc.jiandaoyun.com/doc/13927 通过API接口查询单条数据,支持过滤。返回的数据包含系统字段和表单字段。 ```APIDOC ## 数据API - 查询单条数据接口 ### Description 查询指定表单的单条数据,支持过滤。 ### Method POST ### Endpoint https://www.jiandaoyun.com/api/v1/data/query ### Parameters #### Request Body - **appId** (string) - Required - 应用ID - **formId** (string) - Required - 表单ID - **dataId** (string) - Required - 数据ID - **filter** (object) - Optional - 数据过滤条件 ``` -------------------------------- ### Get Current User's Nickname Source: https://hc.jiandaoyun.com/doc/13970 Use the GETUSERNAME() function to automatically retrieve the current user's nickname. This is useful for including user-specific data in formulas. ```formula GETUSERNAME() ``` -------------------------------- ### 配置智能助手Pro新增数据赋值 Source: https://hc.jiandaoyun.com/doc/15685 在智能助手Pro的修改数据节点中,当需要新增记录时,为目标表单的字段设置相应的值。 ```JSON { "mode": "新增数据", "field_assignments": [ {"field": "会议室编号", "value": "触发数据--会议室编号"}, {"field": "当前时间", "value": "触发数据--当前时间"}, {"field": "会议主题", "value": "触发数据--会议主题"}, {"field": "预约人", "value": "触发数据--预约人"} ] } ```