langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.33k stars 7.21k forks source link

The filtering conditions for querying records in Feishu's multi-dimensional table tool have become ineffective #9915

Open WUXM5 opened 4 days ago

WUXM5 commented 4 days ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

I have followed the document https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-record/record-filter-guide to write the filter code: "{"filter": {"conjunction": "and", "conditions": [{"field_name": "是否取卡", "operator": "is", "value": ["否"]}]}} "The workflow runs normally, but the filter does not execute, and no error appears. I tested the same code in Feishu's debug platform and it works fine.

{ "app_token": "XXXXX", "table_id": "XXXXX", "field_names": "[\"文本\",\"类型\"]", "view_id": "XXXXXX", "table_name": "", "sort": "[{\"field_name\":\"文本\",\"desc\":false}]", "filter": "{\"filter\": {\"conjunction\": \"and\", \"conditions\": [{\"field_name\": \"是否取卡\", \"operator\": \"is\", \"value\": [\"否\"]}]}}", "page_token": "" }

✔️ Expected Behavior

Data filtering is effective.

❌ Actual Behavior

Data filtering is not effective.

dosubot[bot] commented 4 days ago

@WUXM5 Hello! I'm here to help you with any bugs, questions, or contributions you have. I'm an expert bot designed to assist you while you wait for a human maintainer.

The issue you're experiencing with the filter conditions not working in Dify could be related to the format or configuration of the filter JSON object. Ensure that the filter JSON object is correctly formatted according to Dify's requirements when integrating with 飞书多维表格. Here's the correct format for the filter JSON object:

[
  {
    "controlId": "string", // fieldId
    "dataType": "number", // fieldTypeId
    "spliceType": "number", // condition concatenation method, 1: And, 2: Or
    "filterType": "number", // expression type, refer to the <FilterTypeEnum Reference> for enumerable values
    "values": ["string"], // optional, values in the condition, for option-type fields, multiple values can be passed
    "value": "string", // optional, value in the condition, a single value can be passed according to the field type
    "dateRange": "number", // optional, date range, mandatory when filterType is 17 or 18, refer to the <DateRangeEnum Reference> for enumerable values
    "minValue": "string", // optional, minimum value for custom range
    "maxValue": "string", // optional, maximum value for custom range
    "isAsc": "boolean" // optional, ascending order, false: descending, true: ascending
  }
]

Make sure that each filter condition is correctly specified with the appropriate controlId, dataType, spliceType, and filterType. If your field is an option-type, ensure that you are using the correct key value from the options in the current field information [1][2].

If the issue persists, double-check the API request and response handling to ensure that the filter is being applied correctly.

To continue talking to Dosu, mention @dosu.