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 filtering #9145

Closed axelekenberg closed 2 years ago

axelekenberg commented 2 years ago

Hi! I have an array like this:

{ "robots": [ { "name": "R2D2", "id": "19385789238" "home": "California" }, { "name": "R2D2", "id": "339949623" "home": "Ohio" }, { "name": "Robby", "id": "242324654" ... }, { "name": "WALL-E", "id": "c3c3c3c3c3c3" ... } ] }

i am using this adaptive expression: select(where(robots, r, r.name == 'R2D2'), n, n.id), to get the id by passing in the name, but if i want to filter on "home" aswell, lets say i want the id of R2D2 with the home California?

dmvtech commented 2 years ago

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

Use and().

select(where(robots, r, and(r.name == 'R2D2', r.home == 'California')), n, n.id)