2

I have "isVisible":false property set for buttons(Action.Submit) in Adaptive cardbut it is not working correctly in Teams mobile app but working correctly in Teams DeskTop app.

I dont want to use Action.ToggleVisibility property as it is not my requirement. I only want to use Action.Submit buttons and want to set initially invisible properties for it. I am using "isVisible":false property set for the buttons but it is working correctly in Teams windows desktop but the same json i am using to render it in Teams mobile app but it is not working as expected.

Is it something like we cannot use isVisible:false property directly for buttons (Action.Submit). I am facing problem as it working fine in desktop but not in Teams mobile.

Please find attachment for your reference. Screenshot of adaptive card designer:

Screenshot of adaptive card designer

Please tell me the solution so that it works the same in Teams Mobile app as it is working in Teams desktop. Screenshot of how it is appearing in Teams windows desktop:

Screenshot of how it is appearing in Teams windows desktop

Screenshot of how it is appearing in Teams Mobile App:

Screenshot of how it is appearing in Teams Mobile App

Please find the way of how i am declaring the property:

{
  "type": "ActionSet",
  "columns": null,
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Yes",
      "id": "attachment"
    },
    {
      "type": "Action.Submit",
      "title": "No",
      "id": "NoAttachment"
    }
  ],
  "text": null,
  "color": null,
  "wrap": false,
  "isVisible": false,
  "id": null
}
Kyle Delaney
  • 11,616
  • 6
  • 39
  • 66
GDeep-09
  • 29
  • 3
  • Why not you create a different action set each action set having property of isVisible : true/false but action set's actions doesn't have property like isVisible – Kiwi Rupela Sep 01 '21 at 16:13

1 Answers1

0

Can you perhaps explain why you want to have items on the card, that are not visible at all?

As an option though, have a look at the "ShowCard" action, which lets one button open/close another section on the card.

[Update based on comments below] As per the comments, it seems like it might make sense to simply create a more simple card in some scenarios, versus a more complex card in others. As a result, you can have a look at this question where some approaches to creating a card are discussed: Display number in adaptive card

Hilton Giesenow
  • 9,809
  • 2
  • 10
  • 24
  • Initially, those items i dont want to display , but i am handling from my code to display those items later. This is the reason i am adding those items in my json. This action is correctly performing when i am trying in desktop but not in Teams mobile app. I want those items to be not visible initially in teams mobile app also. – GDeep-09 Feb 06 '20 at 09:04
  • ahh, ok, so on the -backend- you decide when to show them? In that case, I'd approach this totally differently - if you don't want them to be "seen", then take them out of the card altogether before sending. How you do this depends on how you create your Card. If you have a JSON string, for instance, I would take them out, or not put them in. If you're building your cards in C#, using the AdaptiveCards nuget package for instance, then simply don't add the buttons into the Card object for the scenario that they're not needed by the client – Hilton Giesenow Feb 06 '20 at 09:07
  • @HiltonGiesenow - A request for more information should be posted as a comment, not an answer. Stack Overflow answers should stand on their own so that further discussion may be helpful but not necessary. – Kyle Delaney Feb 06 '20 at 17:00
  • Thanks Kyle, I do appreciate that - I think the answer was perfectly applicable given the knowledge at the time, hence posted as such, but wanted to probe more in case it revealed something more relevant. In this case it did. – Hilton Giesenow Feb 06 '20 at 17:03
  • @HiltonGiesenow - Again, the place to probe more is in the comments. Probing more in comments would have revealed the same information. – Kyle Delaney Feb 06 '20 at 17:51
  • But as per the documentations, it is the default behaviour of isVisible property of Adaptive cards, that when it is set "true", it should display that element and when it is set "false" , it should not display that element. Please let me know why it is behaving differently in Teams desktop and Teams mobile app. – GDeep-09 Feb 07 '20 at 10:20