Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Bot Framework Composer: Error Accessing Nested JSON Properties #9692

@aymiee

Description

@aymiee

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:

  1. Send an HTTP request and store the result in turn.results.
  2. Attempt to access a nested JSON property turn.results.text.content.data,
  3. 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?..." 
    } 
  } 
}

Metadata

Metadata

Labels

Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.Needs-triageA new issue that require triageType: BugSomething isn't workingcustomer-replied-toRequired for internal reporting. Do not delete.customer-reportedRequired for internal Azure reporting. Do not delete.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions