botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[MS Teams] Inactive fields in FormFlow cause bot to fail in MS Teams

Open Frank-Bursitzke opened this issue 9 years ago • 7 comments

Pre-flight checklist


System Information (Required)

  • SDK Platform: .NET
  • SDK Version: 3.8.1
  • Development Environment: Azure App Service

Issue Description

I've created a bot that uses FormFlow and creates the form from a JSON file, similar to the Sandwich Bot Example. Also like the Sandwich bot, there are some fields with an Active script. I deployed the bot to Azure and added an MS Teams connector.

If the Active condition for a field is not met (field should be skipped), this causes the bot to fail with message "Sorry, my bot code is having an issue." and start over again in MS Teams. The Web Chat displays empty "bubbles" in the conversation. Testing it locally with the channel emulator is just working fine and does not show any issues.

The bot portal shows issues on the Microsoft Teams channel with message: "Activity must include non empty 'text' field or at least 1 attachment"

Example Code

      "Size": {
         "Prompt": { "Patterns": [ "What size? {||}" ] },
         "type": [ "string", "null" ],
         "enum": [
            "half",
            "full"
         ],
         "Active": "return ((string)state[\"Order\"]).StartsWith(\"xyz\");"
      },

Steps to Reproduce

  1. Create a bot using FormFlow with inactive fields
  2. Publish to Azure and add a MS Teams connector
  3. Start a conversation in Teams and cause the Active confition for a field to evaluate to false

Expected Behavior

Field should be skipped (like the channel emulator does).

Actual Results

Bot fails with message "Sorry, my bot code is having an issue." and starts over again, the portal shows the error "Activity must include non empty 'text' field or at least 1 attachment"; Webchat shows empty messages

ms teams

webchat

Frank-Bursitzke avatar May 17 '17 11:05 Frank-Bursitzke

Hi Frank, Have you found a solution to this or are you still having the same issue?

JasonSowers avatar May 22 '17 23:05 JasonSowers

Hi Frank,

I tried the same snippet code and its working for me. can you please let us know if you are still facing the same issue? Here is the output attachment - (I tested with number comparison instead of text)

"Size": { "Prompt": { "Patterns": [ "What size? {||}" ] }, "type": [ "string", "null" ], "enum": [ "half", "full" ], "Active": "return ((string)state["DeliveryAddress"]).StartsWith("123456789");" },

image

please let us know if your scenario is something else.

would appreciate if you can share your code to repo the exact issue.

Thanks Amit Agarwal

vamagra avatar May 30 '17 23:05 vamagra

Hi Amit,

what happens, if you type sth. different than "123456789"? I still get an error, if the field should be inactive (Active evaluates to false).

If it's working in your bot + MS Teams, I see no problem in sharing my code.

BR, Frank

Frank-Bursitzke avatar May 31 '17 06:05 Frank-Bursitzke

Hi Frank,

Sure, will check the false condition as well tomorrow and let you know.

Thanks Amit Agarwal

Get Outlook for Androidhttps://aka.ms/ghei36

From: Frank Bursitzke Sent: Tuesday, May 30, 11:10 PM Subject: Re: [Microsoft/BotBuilder] [MS Teams] Inactive fields in FormFlow cause bot to fail in MS Teams (#2781) To: Microsoft/BotBuilder Cc: Amit Agarwal (HCL America Inc), Comment

Hi Amit,

what happens, if you type sth. different than "123456789"? I still get an error, if the field should be inactive (Active evaluates to false).

If it's working in your bot + MS Teams, I see no problem in sharing my code.

BR, Frank

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FBotBuilder%2Fissues%2F2781%23issuecomment-305093611&data=02%7C01%7Cv-amagra%40microsoft.com%7C6ebf04d5f0ed4250abbb08d4a7ebcd30%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636318078581567205&sdata=XmHExH3J8umy9gsww%2Bm2U8HDfX%2FuNweqOUvuIONRAP8%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAY3PNa4QqgopstV5aeGkSoSy83ay8WVlks5r_QRugaJpZM4Ndvzq&data=02%7C01%7Cv-amagra%40microsoft.com%7C6ebf04d5f0ed4250abbb08d4a7ebcd30%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636318078581567205&sdata=B6cRoY0ki2eVGmqOoUdQE2L6PhpIpzUknWBFU7oY7Bk%3D&reserved=0.

vamagra avatar May 31 '17 06:05 vamagra

Hi Frank,

I tried with false condition and it's just skip that step. Seems working for me!!

Can you please share your code to debug it here?

Thanks Amit Agarwal From: Amit Agarwal (HCL America Inc) Sent: Tuesday, May 30, 2017 11:41 PM To: Microsoft/BotBuilder [email protected]; Frank Bursitzke [email protected] Cc: Comment [email protected]; Dan Herron [email protected] Subject: Re: [Microsoft/BotBuilder] [MS Teams] Inactive fields in FormFlow cause bot to fail in MS Teams (#2781)

Hi Frank, Sure, will check the false condition as well tomorrow and let you know. Thanks Amit Agarwal Get Outlook for Androidhttps://aka.ms/ghei36

From: Frank Bursitzke Sent: Tuesday, May 30, 11:10 PM Subject: Re: [Microsoft/BotBuilder] [MS Teams] Inactive fields in FormFlow cause bot to fail in MS Teams (#2781) To: Microsoft/BotBuilder Cc: Amit Agarwal (HCL America Inc), Comment

Hi Amit, what happens, if you type sth. different than "123456789"? I still get an error, if the field should be inactive (Active evaluates to false). If it's working in your bot + MS Teams, I see no problem in sharing my code. BR, Frank

You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FBotBuilder%2Fissues%2F2781%23issuecomment-305093611&data=02%7C01%7Cv-amagra%40microsoft.com%7C6ebf04d5f0ed4250abbb08d4a7ebcd30%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636318078581567205&sdata=XmHExH3J8umy9gsww%2Bm2U8HDfX%2FuNweqOUvuIONRAP8%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAY3PNa4QqgopstV5aeGkSoSy83ay8WVlks5r_QRugaJpZM4Ndvzq&data=02%7C01%7Cv-amagra%40microsoft.com%7C6ebf04d5f0ed4250abbb08d4a7ebcd30%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636318078581567205&sdata=B6cRoY0ki2eVGmqOoUdQE2L6PhpIpzUknWBFU7oY7Bk%3D&reserved=0.

vamagra avatar May 31 '17 18:05 vamagra

@Frank-Bursitzke is this issue still happening? If so, could you post your code? Thanks!

SheriEllisMSFT avatar Jun 20 '17 22:06 SheriEllisMSFT

please reopen this issue if needed

JasonSowers avatar Aug 08 '17 22:08 JasonSowers