Skip to main content

Notifications

Copilot Studio - General
Answered

Parse an JSON of a HTTP response

Posted on by 12

Hello guys!

I need help parsing the response from an HTTP request, like this:

 

First step:

"https://br-demo-5.topdesk.net/tas/api/persons?query=phoneNumber=="&Topic.telefone

fbanik_0-1715350906590.pngfbanik_1-1715350945419.png

 



After this GET, here de whole answer:

 

[{“attention”:null,“attentionComment”:“”,“authorizeAll”:true,“authorizeBranch”:true,“authorizeBudgetHolder”:true,“authorizeDepartment”:true,“authorizeSubsidiaryBranches”:true,“birthName”:“Marcelo Almeida”,“branch”:{“clientReferenceNumber”:“”,“extraA”:null,“extraB”:null,“id”:“85a55557-e74f-4f14-b07b-8897df29a272”,“name”:“S\u00E3o Paulo”,“timeZone”:“Brazil/East”},“budgetHolder”:{“id”:“b9574d6e-83ab-4313-9b27-0bbe27ae81c3”,“name”:“ADM”},“city”:“S\u00E3o Paulo”,“clientReferenceNumber”:“”,“creationDate”:“2022-06-13T13:29:23.000\u002B0000”,“creator”:null,“department”:{“id”:“6570e7d9-1fcc-45a6-a6d8-84ec64ccfd2f”,“name”:“Helpdesk”},“departmentFree”:null,“dynamicName”:“Marcelo Almeida",“email”:"marceloalmeida@hotmail.com​”,“employeeNumber”:“44”,“fax”:“”,“firstInitials”:“”,“firstName”:“Marcelo”,“gender”:“MALE”,“hasAttention”:false,“id”:“860fb3fa-4f70-4826-9c29-f9242614725a”,“isManager”:true,“jobTitle”:“RCA”,“language”:null,“location”:null,“mainframeLoginName”:“”,“manager”:{“id”:“67a7a04f-fa49-40f0-a27f-79291868a466”,“name”:“Ina Mendoza”},“mobileNumber”:“”,“modificationDate”:“2024-04-18T17:45:33.000\u002B0000”,“modifier”:{“id”:“b944e70b-ed65-458d-b550-edc3323c851c”,“name”:“Code7”},“networkLoginName”:“”,“optionalFields1”:{“boolean1”:false,“boolean2”:false,“boolean3”:false,“boolean4”:false,“boolean5”:false,“date1”:null,“date2”:“2024-02-28T17:43:58.717\u002B0000”,“date3”:null,“date4”:null,“date5”:null,“memo1”:null,“memo2”:null,“memo3”:null,“memo4”:null,“memo5”:null,“number1”:0.0,“number2”:0.0,“number3”:0.0,“number4”:0.0,“number5”:0.0,“searchlist1”:{“id”:“8e7b6668-d611-4c78-9464-5c29dceef2cf”,“name”:“Sim”},“searchlist2”:{“id”:“9d3bb71f-8b42-40a2-9fc2-a7e4a4ee3774”,“name”:“N\u00E3o”},“searchlist3”:null,“searchlist4”:null,“searchlist5”:null,“text1”:“”,“text2”:“”,“text3”:“”,“text4”:“”,“text5”:“”},“optionalFields2”:{“boolean1”:false,“boolean2”:false,“boolean3”:false,“boolean4”:false,“boolean5”:false,“date1”:null,“date2”:null,“date3”:null,“date4”:null,“date5”:null,“memo1”:null,“memo2”:null,“memo3”:null,“memo4”:null,“memo5”:null,“number1”:0.0,“number2”:0.0,“number3”:0.0,“number4”:0.0,“number5”:0.0,“searchlist1”:null,“searchlist2”:null,“searchlist3”:null,“searchlist4”:null,“searchlist5”:null,“text1”:“”,“text2”:“”,“text3”:“”,“text4”:“”,“text5”:“”},“personExtraFieldA”:null,“personExtraFieldB”:null,“phoneNumber”:“19997394600”,“prefixes”:“”,“showAllBranches”:false,“showBranch”:true,“showBudgetholder”:true,“showDepartment”:true,“showSubsidiaries”:true,“status”:“person”,“surName”:“Almeida”,“tasLoginName”:“malmeida”,“title”:“”}]

I would like to store just the "dynamicName" part, is it possible?
field "Marcelo Almeida" in a variable called "parsedName"

How can I do it?

Thanks in advance!

  • Viswav Profile Picture
    Viswav 94 on at
    Re: Parse an JSON of a HTTP response

    Thanks. Works now, my bad. 

  • fbanik Profile Picture
    fbanik 12 on at
    Re: Parse an JSON of a HTTP response

    Thank you man!

    It worked for me!!

  • alaabitar Profile Picture
    alaabitar 1,509 on at
    Re: Parse an JSON of a HTTP response

    if you paste your json to https://jsonlint.com/ is it a valid json ?

  • Viswav Profile Picture
    Viswav 94 on at
    Re: Parse an JSON of a HTTP response

    Yep I did. For my use case, the I get the error when I use this JSON:

    Viswav_0-1715683623607.png

     

  • alaabitar Profile Picture
    alaabitar 1,509 on at
    Re: Parse an JSON of a HTTP response

    When you paste your sample did you replace the “” by ". This is what I pasted in the generate from sample data
    [{"attention":null,"attentionComment":"","authorizeAll":true,"authorizeBranch":true,"authorizeBudgetHolder":true,"authorizeDepartment":true,"authorizeSubsidiaryBranches":true,"birthName":"Marcelo Almeida","branch":{"clientReferenceNumber":"","extraA":null,"extraB":null,"id":"85a55557-e74f-4f14-b07b-8897df29a272","name":"S\u00E3o Paulo","timeZone":"Brazil/East"},"budgetHolder":{"id":"b9574d6e-83ab-4313-9b27-0bbe27ae81c3","name":"ADM"},"city":"S\u00E3o Paulo","clientReferenceNumber":"","creationDate":"2022-06-13T13:29:23.000\u002B0000","creator":null,"department":{"id":"6570e7d9-1fcc-45a6-a6d8-84ec64ccfd2f","name":"Helpdesk"},"departmentFree":null,"dynamicName":"Marcelo Almeida","email":"marceloalmeida@hotmail.com​","employeeNumber":"44","fax":"","firstInitials":"","firstName":"Marcelo","gender":"MALE","hasAttention":false,"id":"860fb3fa-4f70-4826-9c29-f9242614725a","isManager":true,"jobTitle":"RCA","language":null,"location":null,"mainframeLoginName":"","manager":{"id":"67a7a04f-fa49-40f0-a27f-79291868a466","name":"Ina Mendoza"},"mobileNumber":"","modificationDate":"2024-04-18T17:45:33.000\u002B0000","modifier":{"id":"b944e70b-ed65-458d-b550-edc3323c851c","name":"Code7"},"networkLoginName":"","optionalFields1":{"boolean1":false,"boolean2":false,"boolean3":false,"boolean4":false,"boolean5":false,"date1":null,"date2":"2024-02-28T17:43:58.717\u002B0000","date3":null,"date4":null,"date5":null,"memo1":null,"memo2":null,"memo3":null,"memo4":null,"memo5":null,"number1":0.0,"number2":0.0,"number3":0.0,"number4":0.0,"number5":0.0,"searchlist1":{"id":"8e7b6668-d611-4c78-9464-5c29dceef2cf","name":"Sim"},"searchlist2":{"id":"9d3bb71f-8b42-40a2-9fc2-a7e4a4ee3774","name":"N\u00E3o"},"searchlist3":null,"searchlist4":null,"searchlist5":null,"text1":"","text2":"","text3":"","text4":"","text5":""},"optionalFields2":{"boolean1":false,"boolean2":false,"boolean3":false,"boolean4":false,"boolean5":false,"date1":null,"date2":null,"date3":null,"date4":null,"date5":null,"memo1":null,"memo2":null,"memo3":null,"memo4":null,"memo5":null,"number1":0.0,"number2":0.0,"number3":0.0,"number4":0.0,"number5":0.0,"searchlist1":null,"searchlist2":null,"searchlist3":null,"searchlist4":null,"searchlist5":null,"text1":"","text2":"","text3":"","text4":"","text5":""},"personExtraFieldA":null,"personExtraFieldB":null,"phoneNumber":"19997394600","prefixes":"","showAllBranches":false,"showBranch":true,"showBudgetholder":true,"showDepartment":true,"showSubsidiaries":true,"status":"person","surName":"Almeida","tasLoginName":"malmeida","title":""}]

  • Viswav Profile Picture
    Viswav 94 on at
    Re: Parse an JSON of a HTTP response

    But when I tried the same, I get an error 

    Viswav_0-1715682202845.png

     

  • Verified answer
    alaabitar Profile Picture
    alaabitar 1,509 on at
    Re: Parse an JSON of a HTTP response

    Hello @fbanik 

    so first you would need to generate the response data type from sample data by pasting your json example.

    alaabitar_0-1715667727309.pngalaabitar_1-1715667749528.png

    Then you can use this type of formula to put all the dynamnicName into a table

    alaabitar_2-1715667836234.png

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,006

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,059

Leaderboard