Kumudini Jadhav
Kumudini Jadhav

Reputation: 35

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

Working on sending email on http trigger with attachments in logic app. Providing json input as below

{
    "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"
}

passing attachment in base64 string format. But while configuring attachments for content variable getting an error

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

enter image description here

Upvotes: 2

Views: 1267

Answers (1)

Frank Borzage
Frank Borzage

Reputation: 6816

You need to click on Add dynamic content and use the following expression:

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

enter image description here

Upvotes: 0

Related Questions