You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power Automate向MuleSoft IDP传PDF时base64ToBinary报错求助

Power Automate 发送PDF到MuleSoft IDP 报错求助

背景

  • 正在搭建云端Power Automate流,用于将PDF文件发送至MuleSoft IDP,已在MuleSoft平台完成文档操作创建并准备好POST请求URI
  • 流触发逻辑:机器人邮箱收到包含PDF附件且主题符合特定要求的邮件时启动,随后进入「For Each Attachment」循环处理附件

核心错误

无法处理操作'HTTP_-_Post_Doc_1'输入中的模板语言表达式,行'0'列'0':'模板语言函数'base64ToBinary'期望参数为字符串类型,但提供的值为Object类型。请查看https://aka.ms/logicexpressions#base64ToBinary了解使用详情。'

已尝试在线搜索及ChatGPT查找解决方案,但均未解决问题,目前也没有Power Automate与MuleSoft IDP结合的视频教程,恳请提供技术指导。

流程代码(已隐去认证与URI细节)

"type": "Foreach",
  "foreach": "@triggerOutputs()?['body/attachments']",
  "actions": {
    "Condition": {
      "type": "If",
      "expression": {
        "and": [
          {
            "contains": [
              "@item()?['name']",
              ".PDF"
            ]
          },
          {
            "equals": [
              "@item()?['isInline']",
              false
            ]
          }
        ]
      },
      "actions": {
        "Get_attachment_content": {
          "type": "OpenApiConnection",
          "inputs": {
            "parameters": {
              "messageId": "@triggerOutputs()?['body/id']",
              "attachmentId": "@item()?['id']"
            },
            "host": {
              "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
              "connection": "shared_office365-1",
              "operationId": "GetAttachment_V2"
            }
          }
        },
        "HTTP_-_Post_Doc_1": {
          "type": "Http",
          "inputs": {
            "uri": "https://idp-rt.us-east-1.anypoint.mulesoft.com/api/v1/organizations/...",
            "method": "POST",
            "headers": {
              "Content-Type": "multipart/form-data; boundary=boundary_123456"
            },
            "body": "--boundary_123456\nContent-Disposition: form-data; name=\"file\"; filename=\"@{item()?['name']}\"\nContent-Type: application/pdf\n\n@{base64ToBinary(coalesce(body('Get_attachment_content')?['$content'], body('Get_attachment_content'), item()?['contentBytes']))}\n--boundary_123456--",
            "authentication": {
              "type": "Basic",
              "username": "...",
              "password": "..."
            }
          },
          "runAfter": {
            "Get_attachment_content": [
              "Succeeded"
            ]
          },
          "runtimeConfiguration": {
            "contentTransfer": {
              "transferMode": "Chunked"
            },
            "secureData": {
              "properties": [
                "inputs",
                "outputs"
              ]
            }
          }
        }
      },
      "else": {
        "actions": {}
      }
    }
  },
  "runAfter": {}
}

MuleSoft IDP POST API详情

MuleSoft IDP POST API参数详情

内容的提问来源于stack exchange,提问作者Steven

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 11:45:06