Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
70 stars 71 forks source link

"Enter request content" when apply Json in HTTP action in connector card format (Microsoft 365) #4758

Closed vasiliy-grinko closed 1 month ago

vasiliy-grinko commented 1 month ago

Describe the Bug with repro steps

  1. Create HTTP action
  2. Put Json from https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL%2Ctext1#example-of-connector-message
  3. try to save

What type of Logic App Is this happening in?

Consumption (Portal)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
    "@type": "MessageCard",
    "@context": "http://schema.org/extensions",
    "themeColor": "0076D7",
    "summary": "@{triggerBody()?['data']?['essentials']?['alertRule']}",
    "sections": [{
        "activityTitle": "@{triggerBody()?['data']?['essentials']?['alertRule']}-@{body('Read_a_resource')?['name']}",
        "activitySubtitle": "@{triggerBody()?['data']?['essentials']?['description']}",
        "activityImage": "https://i.ibb.co/8BzRTCJ/vecteezy-fire-png-graphic-clipart-design-19906467.png",
        "facts": [{
            "name": "Severity",
            "value": "@{triggerBody()?['data']?['essentials']?['severity']}"
        },
        {
            "name": "Status",
            "value": "@{triggerBody()?['data']?['essentials']?['monitorCondition']}"
        }],
        "markdown": true
    }],
    "potentialAction": [{
        "@type": "ActionCard",
        "name": "Add a comment",
        "inputs": [{
            "@type": "TextInput",
            "id": "comment",
            "isMultiline": false,
            "title": "Add a comment here for this task"
        }],
        "actions": [{
            "@type": "HttpPOST",
            "name": "Add comment",
            "target": "https://learn.microsoft.com/outlook/actionable-messages"
        }]
    }, {
        "@type": "ActionCard",
        "name": "Set due date",
        "inputs": [{
            "@type": "DateInput",
            "id": "dueDate",
            "title": "Enter a due date for this alert"
        }],
        "actions": [{
            "@type": "HttpPOST",
            "name": "Save",
            "target": "https://learn.microsoft.com/outlook/actionable-messages"
        }]
    }, {
        "@type": "OpenUri",
        "name": "Go to resource",
        "targets": [{
            "os": "default",
            "uri": "https://portal.azure.com/#@pethealthinc.com/resource@{items('For_each')}"
        }]
    }]
}

Screenshots or Videos

image

Browser

Edge

Additional context

Workflow JSON is Json that i'm trying to save on HTTP's body. Json is vaild.

preetriti1 commented 1 month ago

@vasiliy-grinko - The issue is with @type and anything you have starting with "@". FOr Logicapps anything which starts with @ is a template function keyword, so it should be escaped with @ ie for having @type in your payload you should be writing @@type, and @type would be actually sent in your payload. If you correct those, it should save fine.