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 / Power Automate / Format JSON - access d...
Power Automate
Answered

Format JSON - access data further

(0) ShareShare
ReportReport
Posted on by

Hi,

I have the below HTTP request and I want to be able to access the "answer" data held in the "memory" key.

 

I can process the JSON by reading the formdata and I can get to the memory key, but I can't work out how to then process the data held in the value of the memory key to get access to the answer data - eg first name/john.

 

 

{
 "$content-type": "application/x-www-form-urlencoded; charset=utf-8",
 "$content": "Q3VycmVudFRhc2s9Q2hlY2tSZW50QmFsYW5jZSZDdXJyZW50SW5wdXQ9bWs3JTIwN3N4JkRpYWxvZ3VlU2lkPVVLYWVjMmExZDVkYmViNDJlN2E5NGJmYTIwN2U0NzY5OGQmTWVtb3J5PSU3QiUyMnR3aWxpbyUyMiUzQSU3QiUyMmNoYXQlMjIlM0ElN0IlMjJDaGFubmVsU2lkJTIyJTNBJTIyQ0hlODYyZDBiMjRmOTI0YWNmYTMyYzgwYWVhMGI4Y2ZjMyUyMiUyQyUyMkFzc2lzdGFudE5hbWUlMjIlM0ElMjIlMjIlMkMlMjJBdHRyaWJ1dGVzJTIyJTNBJTdCJTdEJTJDJTIyU2VydmljZVNpZCUyMiUzQSUyMklTMWY5OWFmNzExYTQ4NDBmMjkwM2ZkZGIyNGM3NGVjNTIlMjIlMkMlMjJJbmRleCUyMiUzQTAlMkMlMjJGcm9tJTIyJTNBJTIydXNlciUyMiUyQyUyMk1lc3NhZ2VTaWQlMjIlM0ElMjJJTWVjNjUyNjI1OGRjYzRhMWE5OGVlZjk1MWRiMjE4MTU2JTIyJTdEJTJDJTIyY29sbGVjdGVkX2RhdGElMjIlM0ElN0IlMjJ0ZW5hbmN5X2NoZWNrJTIyJTNBJTdCJTIyYW5zd2VycyUyMiUzQSU3QiUyMnN1cm5hbWUlMjIlM0ElN0IlMjJjb25maXJtX2F0dGVtcHRzJTIyJTNBMCUyQyUyMmFuc3dlciUyMiUzQSUyMmR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JkRpYWxvZ3VlUGF5bG9hZFVybD1odHRwcyUzQSUyRiUyRmF1dG9waWxvdC50d2lsaW8uY29tJTJGdjElMkZBc3Npc3RhbnRzJTJGVUE3MTU1MmYwZGU4MmFlYzg5MjI4OWRmNzA0NmM1MDcxNiUyRkRpYWxvZ3VlcyUyRlVLYWVjMmExZDVkYmViNDJlN2E5NGJmYTIwN2U0NzY5OGQmQ2hhbm5lbD1jaGF0Jk5leHRCZXN0VGFzaz1nb29kYnllJkN1cnJlbnRUYXNrQ29uZmlkZW5jZT0xLjAmQXNzaXN0YW50U2lkPVVBNzE1NTJmMGRlODJhZWM4OTIyODlkZjcwNDZjNTA3MTYmVXNlcklkZW50aWZpZXI9dXNlciZBY2NvdW50U2lkPUFDYjRiNWI1NGIzNjlhMzI1MTEwMTA0ZWMwYjcwYmQwYjY=",
 "$formdata": [
 {
 "key": "CurrentTask",
 "value": "xxx"
 },
 {
 "key": "CurrentInput",
 "value": "xxxx"
 },
 {
 "key": "DialogueSid",
 "value": "xxxx"
 },
 {
 "key": "Memory",
 "value": "{\"twilio\":{\"chat\":{\"ChannelSid\":\"xxxx\",\"AssistantName\":\"\",\"Attributes\":{},\"ServiceSid\":\"xxxx\",\"Index\":0,\"From\":\"user\",\"MessageSid\":\"xxxxx\"},\"collected_data\":{\"tenancy_check\":{\"answers\":{\"surname\":{\"confirm_attempts\":0,\"answer\":\"doe\",\"filled\":true,\"type\":\"Twilio.LAST_NAME\",\"confirmed\":false,\"validate_attempts\":1,\"attempts\":1},\"first_name\":{\"confirm_attempts\":0,\"answer\":\"john\",\"filled\":true,\"type\":\"Twilio.FIRST_NAME\",\"confirmed\":false,\"validate_attempts\":1,\"attempts\":1},\"postcode\":{\"answer\":\"M7\",\"type\":\"Twilio.ALPHANUMERIC\",\"filled\":true,\"attempts\":1,\"validate_attempts\":1,\"confirm_attempts\":0,\"confirmed\":false,\"media\":null}},\"date_completed\":\"2020-12-01T15:35:59Z\",\"date_started\":\"2020-12-01T15:35:44Z\",\"status\":\"complete\"}}}}"
 },
 {
 "key": "DialoguePayloadUrl",
 "value": "https://autopilot.twilio.com/v1/Assistants/UA71552f0de82aec892289df7046c50716/Dialogues/UKaec2a1d5dbeb42e7a94bfa207e47698d"
 },
 {
 "key": "Channel",
 "value": "chat"
 },
 {
 "key": "NextBestTask",
 "value": "goodbye"
 },
 {
 "key": "CurrentTaskConfidence",
 "value": "1.0"
 },
 {
 "key": "AssistantSid",
 "value": "xxxx"
 },
 {
 "key": "UserIdentifier",
 "value": "user"
 },
 {
 "key": "AccountSid",
 "value": "xxxxx"
 }
 ]
}

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    on at

    Hi @bphaSD,

     

    You could following these steps to parse the json:

    1. use Filter array to extract item that key equals Memory;

    2. Then use Apply to each to loop filtered out array;

    3. Use json() function convert the value from string to json;

    4. Use Parse JSON action to parse the json, then we could get 3 dynamic content "answer":

    This is JSON schema:

    {
     "type": "object",
     "properties": {
     "twilio": {
     "type": "object",
     "properties": {
     "chat": {
     "type": "object",
     "properties": {
     "ChannelSid": {
     "type": "string"
     },
     "AssistantName": {
     "type": "string"
     },
     "Attributes": {
     "type": "object",
     "properties": {}
     },
     "ServiceSid": {
     "type": "string"
     },
     "Index": {
     "type": "integer"
     },
     "From": {
     "type": "string"
     },
     "MessageSid": {
     "type": "string"
     }
     }
     },
     "collected_data": {
     "type": "object",
     "properties": {
     "tenancy_check": {
     "type": "object",
     "properties": {
     "answers": {
     "type": "object",
     "properties": {
     "surname": {
     "type": "object",
     "properties": {
     "confirm_attempts": {
     "type": "integer"
     },
     "answer": {
     "type": "string"
     },
     "filled": {
     "type": "boolean"
     },
     "type": {
     "type": "string"
     },
     "confirmed": {
     "type": "boolean"
     },
     "validate_attempts": {
     "type": "integer"
     },
     "attempts": {
     "type": "integer"
     }
     }
     },
     "first_name": {
     "type": "object",
     "properties": {
     "confirm_attempts": {
     "type": "integer"
     },
     "answer": {
     "type": "string"
     },
     "filled": {
     "type": "boolean"
     },
     "type": {
     "type": "string"
     },
     "confirmed": {
     "type": "boolean"
     },
     "validate_attempts": {
     "type": "integer"
     },
     "attempts": {
     "type": "integer"
     }
     }
     },
     "postcode": {
     "type": "object",
     "properties": {
     "answer": {
     "type": "string"
     },
     "type": {
     "type": "string"
     },
     "filled": {
     "type": "boolean"
     },
     "attempts": {
     "type": "integer"
     },
     "validate_attempts": {
     "type": "integer"
     },
     "confirm_attempts": {
     "type": "integer"
     },
     "confirmed": {
     "type": "boolean"
     },
     "media": {}
     }
     }
     }
     },
     "date_completed": {
     "type": "string"
     },
     "date_started": {
     "type": "string"
     },
     "status": {
     "type": "string"
     }
     }
     }
     }
     }
     }
     }
     }
    }

     

    Screenshot 2020-12-03 150023.jpg

     

    Screenshot 2020-12-03 150059.jpg

     

    Screenshot 2020-12-03 150128.jpg

     

    You could also use the expression to extract them:

    outputs('Compose_2')?['twilio']?['collected_data']?['tenancy_check']?['answers']?['surname']?['answer']
    outputs('Compose_2')?['twilio']?['collected_data']?['tenancy_check']?['answers']?['first_name']?['answer']
    outputs('Compose_2')?['twilio']?['collected_data']?['tenancy_check']?['answers']?['postcode']?['answer']

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard