-
Notifications
You must be signed in to change notification settings - Fork 374
Bot Framework Composer: Error Accessing Nested JSON Properties #9692
Description
Describe the bug
When attempting to access the 'data' property from a JSON response in Bot Framework Composer using turn.results.text, the path returns empty. Direct access and expressions such as ${json(turn.results.text.content.data)} lead to an "Operation returned an invalid status code 'BadRequest'" error.
My web app use to return the response in 'message' field and I was able to retrieve it via : ${turn.results.content.data.message}
Recently, I started getting "Operation returned an invalid status code 'BadRequest'". The structure of ${turn.results} has changed to:
{ "lgType": "Activity", "text": { "statusCode": 200, "reasonPhrase": "OK", "headers": { "Date": "Mon, 22 Jan 2024 04:58:15 GMT", "Server": "gunicorn" }, "content": { "data": "How can I assist you today? If you have any IT-related queries, need information from the company data, or have compliance-related questions, feel free to ask!" } } }
Attempts to access the data with ${getProperty(turn.results.text.content, 'data')} and ${turn.results.text.content.data} have been unsuccessful resulting in Operation returned an invalid status code 'BadRequest'
Additionally, ${turn.results.text.content} and ${turn.results.text} are returning empty.
Version
Version: 2.1.2
Electron: 8.2.4
Chrome: 80.0.3987.165
NodeJS: 12.13.0
V8: 8.0.426.27-electron.0
Browser
- Electron distribution
- Chrome
- Safari
- Firefox
- Edge
OS
- macOS
- Windows
- Ubuntu
To Reproduce
Steps to reproduce the behavior:
- Send an HTTP request and store the result in
turn.results. - Attempt to access a nested JSON property
turn.results.text.content.data, - Receive an empty response or an error.
Expected behavior
Screenshots
Additional context
The exact JSON response structure is as follows:
{
"lgType": "Activity",
"text": {
"statusCode": 200,
"reasonPhrase": "OK",
"headers": {
"Date": "Mon, 22 Jan 2024 04:31:39 GMT",
"Server": "gunicorn"
},
"content": {
"data": "It seems like there might have been a typo in your message. How can I assist you today?..."
}
}
}