Skip to content

port: [Expression]Add stringOrValue built-in function (#5138) #3281

Closed

Description

The changes in [Expression]Add stringOrValue built-in function (#5138) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.

Fixes #5009

Description

Introduce a new built-in function that refers to smart interpolation.

The original requirements are:

  • when user input is a simple variable, like ${name} or ${age}, it should evaluate as a single variable and the return type is the variable type (int\float\string, it could vary)
  • when user input is text + variables, like ${age} is too big, it should evaluate as a string intepolation, and always return a string type

Samples:
stringOrValue('${2+3}') -> 5
stringOrValue('woof is ${3+5}') would produce 'woof is 8'.

Changes

Create a new function that can evaluate the value expression smartly.

Please review and, if necessary, port the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Area: Adaptive expressionThe issue is related to Adaptive expressionsparityThe issue describes a gap in parity between two or more platforms.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions