Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Unanswered

Connector returning JSON in curly quotes

(0) ShareShare
ReportReport
Posted on by 44

I'm using an Office 365 Users Send Http Request connector and want to parse the outputs as a table to be used in a generative answers node, however the JSON outputs are in curly quotes instead of straight quotes. 

 

Outputs:

{
“displayName”:“Doe, John”,
“givenName”:“John”
}

Instead of:

{
"displayName":"Doe, John",
"givenName":"John"
}

So despite having the right schema the parse value would return blank since it can't read the output JSON.

Categories:
  • Revl0ck97 Profile Picture
    44 on at
    Re: Connector returning JSON in curly quotes

    Hi @adilei, sorry for the late reply here it is: 

    kind: AdaptiveDialog
    modelDescription: Summary of my profile
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent: {}
     actions:
     - kind: OAuthInput
     id: X4ErUh
     title: Login
     text: Please Login
    
     - kind: SetVariable
     id: setVariable_t1Yg2l
     variable: Topic.varUser
     value: =Concatenate("https://graph.microsoft.com/v1.0/users/", System.User.PrincipalName)
    
     - kind: InvokeConnectorAction
     id: invokeConnectorAction_yyMEjK
     input:
     binding:
     ContentType: application/json
     Method: GET
     Uri: =Topic.varUser
    
     output:
     kind: SingleVariableOutputBinding
     variable: Topic.HttpRequestProfile
    
     connectionReference: cr6bd_psRestCalendarAdTest.cr.fMTI3T3K
     operationId: HttpRequest
    
     - kind: SetVariable
     id: setVariable_4l88ix
     variable: Topic.myTable
     value: =[{Content:Topic.HttpRequestProfile,ContentLocation:Blank()}]
    
     - kind: SendActivity
     id: sendActivity_Qj37l2
     activity: "{Topic.myTable}"
    
     - kind: SearchAndSummarizeContent
     id: searchAndSummarizeContent_7aScH6
     userInput: =System.Activity.Text
     additionalInstructions: Give a general summary of the user's profile. Answer in professional human manner.
     publicDataSource: {}
     sharePointSearchDataSource: {}
     customDataSource:
     searchResults: =Topic.myTable

     

  • adilei Profile Picture
    on at
    Re: Connector returning JSON in curly quotes

    Can you share the YAML for your topic? (from edit code)

  • Revl0ck97 Profile Picture
    44 on at
    Re: Connector returning JSON in curly quotes

    Hi @adilei ,

     

    It works as intended with generative answers node as is but if I incorporate it with the outputs from the Send Http Request action this error pops up:

     

    [{Content:Topic.HttpRequestProfile,ContentLocation:Blank()}]

    Revl0ck97_0-1709091861811.png

     

  • adilei Profile Picture
    on at
    Re: Connector returning JSON in curly quotes

    Create a new topic, click on the three dots and "Open code editor". Then paste the YAML into the code editor.

     

    adilei_0-1709013877358.png

     

  • Revl0ck97 Profile Picture
    44 on at
    Re: Connector returning JSON in curly quotes

    Hi @adilei,

     

    Sorry I'm still quite new to Copilot, where do I insert this? I'm unfamiliar with it. Any Microsoft documentation on this as a guide? Thanks a lot btw.

  • adilei Profile Picture
    on at
    Re: Connector returning JSON in curly quotes

    Here is how to build a new Table variable, in the format Generative Answers expects, by referencing values from an existing Record variable. Let me know if this helps.

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     triggerQueries:
     - add record
    
     actions:
     - kind: SetVariable
     id: setVariable_BiGn8t
     variable: Topic.myRecord
     value: "={key1:\"value1\",key2:\"value2\"}"
    
     - kind: SetVariable
     id: setVariable_4l88ix
     variable: Topic.myTable
     value: =[{Content:Topic.myRecord.key1,ContentLocation:Topic.myRecord.key2}]

    .

     

  • Revl0ck97 Profile Picture
    44 on at
    Re: Connector returning JSON in curly quotes

    Hi @ManikandanS,

     

    I'm, using the Send an HTTP Request Connector action node. Sorry but the sample JSON provided was lacking I just wanted to give a shortened sample.

     

    {
    "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity",
    "businessPhones":[],
    "displayName":"Doe, John",
    "givenName”":"John",
    "id":"12345",
    "jobTitle":"Sample Title",
    "mail":"john.doe@gmail.com",
    "mobilePhone":null,
    "officeLocation":"Sample",
    "preferredLanguage":null,
    "surname":"Doe",
    "userPrincipalName":"john.doe@gmail.com"
    }

    Revl0ck97_0-1708933991481.png

    I was just wondering if there is a way for the outputs to be in straight quotes instead? So that I could work with other Connector JSON outputs other than the connector above so as not to resort to flows. Thanks for the reply!

  • ManikandanS Profile Picture
    246 on at
    Re: Connector returning JSON in curly quotes

    Hello @Revl0ck97 ,

    The display name attribute is already available as part of system variable in co pilot studio, apart from display name there are other attributes readily available with respect to current user. If the attribute is not present, you can get the details from connectors. Are you using flow to connect to office 365 connectors?

     

    Thanks.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - General

#1
stampcoin Profile Picture

stampcoin 8

#2
Artur Stepniak Profile Picture

Artur Stepniak 5 Super User 2025 Season 1

#3
Ekta Gupta Profile Picture

Ekta Gupta 4

Overall leaderboard