0
votes

I am working on a bot build with Microsoft bot framework composer

I have an HTTP request that works and returns an array of programs

Currently, I have a "0" hard set and that works ${dialog.programlistlite.api_response.content.programs[0].name}

what i am trying to do is take property called dialog.resultnumber which is set to 0 and replace static "0" above with property called dialog.resultsnumber

I tried:

${dialog.programlistlite.api_response.content.programs[${dialog.resultsnumber}].name}
${dialog.programlistlite.api_response.content.programs[(dialog.resultsnumber)].name}
${dialog.programlistlite.api_response.content.programs[dialog.resultsnumber].name}
${dialog.programlistlite.api_response.content.programs[getproperty(dialog.resultsnumber)].name}
${dialog.programlistlite.api_response.content.programs[dialog.resultsnumber()].name}
${dialog.programlistlite.api_response.content.programs[${dialog.resultsnumber()}].name} 

I cannot find the syntax to use an already defined property to build a new property

1

1 Answers

0
votes

what i am trying to do is take property called dialog.resultnumber which is set to 0 and replace static "0" above with property called dialog.resultsnumber I tried:

Are you sure that dialog.resultsnumber is an int?

If you set it in a single set property action, make sure you set it as an int, the default is a string.

How to set property to integer type

This below should be the one. It worked for me (with the above caveat): ${dialog.programlistlite.api_response.content.programs[dialog.resultsnumber].name}

You can also use the isInteger() type checking function to confirm if something is an int, or try and force/convert/coerce using int() if needed as well.