Skip to content

Bug: Automation HTTP Request JSON array in body #1527

@skadiD

Description

@skadiD

Describe the bug
When using Teable's automation feature to execute an HTTP request, specifically targeting a WeCom (Enterprise WeChat) bot webhook, the JSON request body containing arrays of objects is incorrectly re-parsed. Instead of sending the actual array of objects, Teable appears to transform structures like [{...}] into [0] and [{}, {}] into [0, 1].

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Automations' section within Teable.
  2. Click on 'Create Automation'.
  3. Add an 'HTTP Request' action to the automation workflow.
  4. Configure the HTTP request:
    • Set the request method to POST.
    • Set the Request URL to WeCom bot webhook URL(Or any other URL).
    • In the "Body" section, select "raw (JSON)" and provide a JSON payload that includes an array of objects. For example, according to the WeCom documentation (文本通知模版卡片), a template_card with a jump_list or horizontal_content_list might be used:
      {
        "msgtype": "template_card",
        "template_card": {
          "card_type": "text_notice",
          // ... other template_card fields
          "jump_list": [
            {
              "type": 1,
              "url": "[https://www.example.com](https://www.example.com)",
              "title": "More"
            }
          ],
          "horizontal_content_list": [
              {
                  "keyname": "Item 1",
                  "value": "Detail 1"
              },
              {
                  "keyname": "Item 2",
                  "value": "Detail 2"
              }
          ]
          // ... other template_card fields
        }
      }
  5. Test the automation.
  6. Observe the request received by the WeCom bot.
  7. See error: The WeCom say Warning: wrong json format. invalid Request Parameter, you will see that the jump_list was sent as [0] (if it had one item) or horizontal_content_list was sent as [0, 1] (if it had two items), instead of the actual object data.

Expected behavior
The HTTP request action in Teable should send the JSON request body exactly as configured. Arrays of objects, such as [{ "type": 1, "url": "https://www.example.com", "title": "More" }], should be transmitted as is, without Teable re-parsing or transforming them into arrays of indices like [0]. The WeCom bot webhook should receive the full, correct JSON structure as defined in the WeCom API documentation.

Screenshots

Image

Image

Client (please complete the following information):

  • OS: windows 10
  • Browser: Edge
  • Version: 136.0.3240.64

Platform (Please tell us which deployment version you are using)
Both teable.io and docker-standalone

Additional context
The core issue is the unexpected re-parsing of JSON arrays within the HTTP request body by Teable's automation. If the request body is configured with an array like [{ "key": "value" }], Teable sends [0]. If configured with [{ "key1": "value1" }, { "key2": "value2" }], Teable sends [0, 1]. This behavior makes it impossible to correctly send structured data to APIs, such as the WeCom bot API, which rely on specific array-of-object formats.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions