microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
869 stars 372 forks source link

Array id handling #9125

Closed axelekenberg closed 2 years ago

axelekenberg commented 2 years ago

Hi! Im working on a project related to robots, i have an API which gives me an array like this: { name: "Michael Pierson" id: "19385789238" age: 12 } . . .

Where i am given parameters with information about the robot in which i have hundreds of these. In my bot i need to send in the id to modify a robot, is there any way that i can convert the robot id to its name so that i only need to tell the bot its name?

dmvtech commented 2 years ago

Hi @axelekenberg

The Microsoft Bot Framework team prefers that how to questions be submitted on Stack Overflow. The official Bot Framework Github repos are the preferred platform for submitting bug fixes and feature requests.

dmvtech commented 2 years ago

Assuming one might have something like:

{
  "robots": [
  {
    "name": "R2D2",
    "id": "19385789238"
  },
  {
    "name": "C3PO",
    "id": "c3c3c3c3c3c3"
  },
  {
    "name": "Robby",
    "id": "242324654"
  },
  {
    "name": "WALL-E",
    "id": "c3c3c3c3c3c3"
  }
  ]
}

You can use the following adaptive expression to select Id by passing in the name: select(where(robots, r, r.name == 'R2D2'), n, n.id)

Prebuilt functions: Select Where

axelekenberg commented 2 years ago

So if i had this array that is above with age also, how can i filter on the age as well, lets say that i want R2D2 with age 15 and not the other ones how do i do that?