Skip to main content

Notifications

Topic Creation & Management
Answered

Exception while generating adaptive card-Missing required property 'OutputType'

Posted on by 8

Hi all- 

this is my adaptive card power fx version:

 {
   type: "AdaptiveCard",
  version: "1.5",
  body: [
    {
      type: "TextBlock",
      text: "Items Stock Overview",
      wrap: true,
      size: "Large",
      weight: "Bolder",
      color: "Accent",
      horizontalAlignment: "Center"
    },
    {
      type: "Container",
      items: ForAll(Topic.Table.body.response,
        {
                      type: "Container",
          items: [
            {
              type: "FactSet",
              facts: [
                {
                  title: "Item Code",
                  value: Text(ThisRecord.ItemCode)
                },
                {
                  title: "Warehouse Code",
                  value: Text(ThisRecord.WhsCode)
                }
              ]          
                       
            }
          ]
        }
      )
    }
  ]
 }
 
When I try to save it I get the following error : Missing required property 'OutputType' - could you please help out ?
  • CumulusSerAdmin Profile Picture
    CumulusSerAdmin 8 on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    Appreciate your answer- seems like I got the point and I was able to bypass that error message-thank you for that!

    However. looking at the way the Copilot is built , I am still a bit confused.

    If we look at the 'Call an Action' node where I invoke a Power Automate flow that returns a response to Copilot- I have only a predefined set of respone types : 

    CumulusSerAdmin_0-1710450191564.png

    Text is widely used and represents the 'String' type.

    However , If I , for instance, use an HTTP action that returns a well-formatted JSON object / array - Copilot still expects a String type and if I send another type of response I get the following message:

    Error Message: The parameter with name ‘responsebody’ on flow ‘SAPCopilot’ (‘c2f15a05-3fdf-ee11-904d-00224806b493’) evaluated to type ‘TableDataType’ , expected type ‘StringDataType’ Error Code: FlowActionBadRequest Conversation Id: 2035dc3d-6ecd-4801-bdf9-548821e1f0a2 Time (UTC): 2024-03-14T20:03:31.642Z

    When I dynamically select the Output variable in Copilot , it "knows" it is a string and therefore will not allow any other type :

    CumulusSerAdmin_1-1710450632731.pngCumulusSerAdmin_2-1710450694364.png

     

     

    calling that action will invoke the above errror - theoretically , I am supposed to get the response from the connector and then parse it usisng sample payload but the call itself fails.

    Any suggestions ? I am sendng back JSON arrays with a collection of items that I would like to show on the Adaptive Card but I can't get to the records in any way.

    Any other design / approach would be appreciated

    Thanks !

  • Verified answer
    adilei Profile Picture
    adilei on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    Okay, I think I understand now. "Ask with adaptive card" expects a static adaptive card structure so it can map inputs to variables. Start with just a JSON payload for your AC, without PowerFX (select JSON not Formula), let the studio map the inputs, and then convert to a formula.

     

    Let me know if this helps.

  • CumulusSerAdmin Profile Picture
    CumulusSerAdmin 8 on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    Look at the attached- the nodes would be : 

    Trigger-->Question-->Action(Plug in Action that calls the Power Automate flow)-->Set Variable( to get the response returned by the flow)-->Parse Value(to render the result by using a JSON schema of what PA returned) -->Adaptive Card

     

    Let me know if you need to knpw anything else.

  • adilei Profile Picture
    adilei on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    But which node are you embedding this card into? Ask with adaptive card? Question? Message?

  • CumulusSerAdmin Profile Picture
    CumulusSerAdmin 8 on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    I am attaching two files ahowcasing the output of the AC code within Copilot (Power FX) and the code itself -if it helps you better in guiding me 

  • CumulusSerAdmin Profile Picture
    CumulusSerAdmin 8 on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

     

    Yes I am - look at the below screenshot- this is an error that is not documented anywhere 

    CumulusSerAdmin_0-1710430219852.png

     

  • adilei Profile Picture
    adilei on at
    Re: Exception while generating adaptive card-Missing required property 'OutputType'

    Are you using "Ask with adaptive card"?

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,995

#3
Expiscornovus Profile Picture

Expiscornovus 1,708

Leaderboard

Featured topics