逻辑应用-发送带附件的电子邮件-"Unable to parse template language expression 'base64('triggerBody()?['contentBytes']')': "

Logic app -send email with attachment-"Unable to parse template language expression 'base64('triggerBody()?['contentBytes']')': "

正在使用逻辑应用中的附件在 http 触发器上发送电子邮件。提供 json 输入如下

{
    "properties": {
        "bcc": {
            "type": "string"
        },
        "body": {
            "type": "string"
        },
        "cc": {
            "type": "string"
        },
        "subject": {
            "type": "string"
        },
        "to": {
            "type": "string"
        },
        "attachments":{
            "name":{
                "type":"string"
            },
            "ContentBytes":{
                "type":"string"
            }
        },
        "type":"object"
    },
    "type": "object"
}

以 base64 字符串格式传递附件。 但是在为内容变量配置附件时出现错误

Unable to parse template language expression 'base64('triggerBody()?['contentBytes']')': expected token 'RightParenthesis' and actual 'Identifier'.".'

您需要单击 Add dynamic content 并使用以下表达式:

base64(triggerBody()?['attachments']?['ContentBytes'])