web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / How to send a Record t...
Copilot Studio
Unanswered

How to send a Record type variable as JSON body for POST request in Copilot Studio

(0) ShareShare
ReportReport
Posted on by 8

Screenshot 2024-02-29 195659.png

Every time i save my changes, the page refreshes and my changes disappear. I guess it doesnt like Topic.Transcript by itself. If i put it within brackets however and with a key (Topic.Transcript as value) then no problems. So it seems to be a type conversion issue between trying to set record variable as json object. How can i convert this variable to json? the schema of the variable is as follow: 

kind: Record
properties:
  activities:
    type:
      kind: Table
      properties:
        attachments:
          type:
            kind: Table
            properties:
              content:
                type:
                  kind: Record
                  properties:
                    $schema: String
                    body:
                      type:
                        kind: Table
                        properties:
                          text: String
                          type: String
                          wrap: Boolean

                    type: String
                    version: String

              contentType: String

        channelId: String
        conversation:
          type:
            kind: Record
            properties:
              id: String

        entities:
          type:
            kind: Table

        from:
          type:
            kind: Record
            properties:
              id: String
              name: String
              role: String

        id: String
        inputHint: String
        listenFor:
          type:
            kind: Table

        membersAdded:
          type:
            kind: Table

        membersRemoved:
          type:
            kind: Table

        name: String
        reactionsAdded:
          type:
            kind: Table

        reactionsRemoved:
          type:
            kind: Table

        replyToId: String
        serviceUrl: String
        speak: String
        suggestedActions:
          type:
            kind: Record
            properties:
              actions:
                type:
                  kind: Table
                  properties:
                    text: String
                    title: String
                    type: String
                    value: String

              to:
                type:
                  kind: Table

        text: String
        textFormat: String
        textHighlights:
          type:
            kind: Table

        timestamp: String
        type: String
I have the same question (0)
  • Verified answer
    adilei Profile Picture
    on at

    I think it's "just" a UI issue. If you peek at the YAML code for the topic, you can see the request body is populated with whatever formula you assigned in the UI, and based on my tests, the call executes successfully.

     

    I think you can raise a case with support regarding the UI - Get Help + Support in Power Platform - Power Platform | Microsoft Learn

     

    Here is the code for my topic:

     

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     triggerQueries:
     - http
    
     actions:
     - kind: SetVariable
     id: setVariable_pgxUkP
     variable: Topic.body
     value: "={key:\"value\"}"
    
     - kind: HttpRequestAction
     id: syBaJ9
     url: https://myurl.com
     body:
     kind: JsonRequestContent
     content: =Topic.body

     

     

  • kush-sg Profile Picture
    on at

    Hello, @adilei 

    I am experiencing an issue with passing user input (variable) in the body of an HTTP POST request in CoPilot Studio. Attached are screenshots illustrating the problem.

    Could you please help me resolve this issue?

    Thank you.

    Best regards,
    Kushagra Sharma

    Variable (Var1), that i want to pass inside payloadVariable (Var1), that i want to pass inside payload

     

    HTTP - Post request bodyHTTP - Post request body

     

    responseresponse

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 205 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard