Date period entity MS Teams

Hi, MS Teams currently supports only date picker.
In our requirement, we ideally want the user to pick a date range.

So, we have over-ridden the to and from date prompts in Date Period entity.

entity

This is a mandatory node, and following the over-ridden message to “to date” prompt

var currentDate = koreUtil.moment().format("YYYY-MM-DD");
var message = { 
    "type": "message",
    "speak": "",
    "text": "Please select start date",
    "attachments": [ 
        { 
            "contentType": "application/vnd.microsoft.card.adaptive",
            "content": { 
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "version": "1.2",
                "body": [
                    { 
                        "type": "Input.Date",
                        "id": "dateperiod",
                        "value": currentDate,
                        "separator": true 
                   }
                ],
                "actions": [
                    { 
                        "type": "Action.Submit",
                        "title": "Submit" 
                    }
                ]
            } 
        } 
    ] 
};

print(JSON.stringify(message)); 

However, the entity doesn’t seem to pick up the value (or) process it correctly. Also, despite being a mandatory node, it is going forward with the next node ( context.entities when printed out returns nothing)
This is response, we see in metrics.

Capture

Hi @srikar.kulkacherla,

We have referred the MS teams documentation for Adaptive cards and also analyzed the input.date type.

We infer that the input.date type can only take a date value as input and not a date range.

And in the given adaptive cards template code, you are assigning the value for the date as currentDate. The entity node is not asking for the input as it already has the value assigned through the script.

Though the entity node type is date period, the Adaptive template accepts only a single date value. Hence, you are observing this behavior.

Kindly contact the Microsoft team for further help on the usage of the template.

Let us know if you need any further clarification.

Regards,
Yoga Ramya

As MS Teams does not have any template for date range selector, we are trying to implement the functionality using a date picker. We have overridden “User From Date Prompt” and “User To Date Prompt” messages in the bot. So, when the from date prompt comes up in MS Teams, the user is ideally selecting a single date which should get assigned to the from date and then then the to date prompt will show up(like in the bot). This method works just fine in Slack but in MS teams it is failing.

Tried removing the value property as well.
This is the updated code,
Capture

As you can see in the below attachment, after picking up a single date (From Date), I am not getting any To Date message prompt. Instead it’s moving forwarding and proceeding with the other nodes.

Capture