[MsTeams]Input.Number is not allowing more than 10 numbers
Platform
- .NetCore
- BotFramework V4
Host
- MS Teams
Hi All,
I am using Input.Number property to collect the phone number from the user. If the user enters the wrong number then I am pre-populating the same Adaptive card filling the number entered by the user.
If the value of number is more than 10 digits, input.number property is not allowing that number.
Please have a look at the Json:-
{"type":"AdaptiveCard","version":"1.0","body":[{"type":"TextBlock","text":"My mobile number"},{"type":"Input.Number","placeholder":"","value":"**962213213213213**","id":"asdas"}],"$schema":"http://adaptivecards.io/schemas/adaptive-card.json"}
This is the error message from Teams App studio:-
Please help.
Thanks.
Thanks for reporting this @Chekrii. So Input.Number is supposed to be a Number type- specifically enforced as a double value in most of the renderers, including the .NET one and JS. After fixing your card to remove the non-number characters, I was able to see it render successfully on our designer (Adaptivecards.io/designer) as well as a quick app that uses our serialization SDK (.NET SDK v1.2.4) - both parsing values as double types ;
string card = "{\"type\":\"AdaptiveCard\",\"version\":\"1.0\",\"body\":[{\"type\":\"TextBlock\",\"text\":\"My mobile number\"},{\"type\":\"Input.Number\",\"placeholder\":\"\",\"value\":\"962213213213213\",\"id\":\"asdas\"}],\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\"}";
try
{
var parseResult = AdaptiveCard.FromJson(card);
//var attachment = new Attachment
//{
// ContentType = AdaptiveCard.ContentType,
// Content = parsedResult.Card,
//};
}
catch (AdaptiveSerializationException e)
{
// handle JSON parsing error
// or, re-throw
throw;
}
In addition, I wonder if your problem will go away with the fix for #3829 where our JS renderer will be updated to allow both numbers and strings for backwards compatibility assuming this App Studio app actually hooks into the JS renderer and not .NET.
FWIW, I am able to repro the bug in Teams App Studio --> Card Editor for AdaptiveCards.. @siduppal / @dclaux / @matthidinger do you know who owns the code here, what AdaptiveCards renderer package it hooks to, and where Attachment type is defined (is it one of the built in Framework types?) - basically how do I debug it?
Thanks!
Hello @shalinijoshi19 , I am not able to render that card in teams using Bot framework.
Thanks @chekrii; i believe that may be due to #3829. @paulcam206 any updates on that one yet? Thanks
This issue has been copied over to Microsoft Teams repo here: https://github.com/MicrosoftDocs/msteams-docs/issues/4773