Hello there, I'm not well-versed in power apps in general so pardon my inexperience.
Now I've been trying to create a datetime picker in PVA and used the following tutorials as a rough guideline:
https://learn.microsoft.com/en-us/power-virtual-agents/advanced-bot-framework-composer-example2
https://learn.microsoft.com/en-us/power-virtual-agents/advanced-bot-framework-composer-example1
(Additionally I went through some similar questions on this forum but it still wouldn't even get published on bot composer)
This is my setup:
Adaptive Card payload + bot response configurations:
Bot Framework Composer Dialog
I also added Dialog Interface Outputs as suggested in a similar answer
This is how it looks in PVA (I initialized a random variable as suggested by another user)
Hi @Renad ,
If you open the Bot Responses on Bot Framework Composer and click on "view code", you will see the adaptive card in json format.
On on of my forms I have the following when related to date picker:
{
"type": "Input.Date",
"label": "Purchase Date",
"id": "PuchaseDate",
"value": "2022-22-22",
"style": "text",
"isRequired": true,
"errorMessage": "Purchase date is required"
},
On BFC the property I created is:
user.PurchaseDate
And the value is:
=turn.activity.value.PurchaseDate
My guess that for the "time" the options are quite similar or the same.
Thank you a lot for your help! It finally works!
you've to add the "=" as well.
it is not assigning the value
Hello there, I changed it to turn.activity.value.TryDate but it still doesn't work
If you change the version to 1.2 it might work.
Cheers
Hello there, I altered the suggested fields however it still doesn't work.
I also changed the ids in the card payload as suggested.
Hi @Renad
I used sample code you provided and built this. Let me know if this helps.
Just small changes to:
set prompt configuration to 1:
Dialog Interface:
and in the code just changed the id:
# adaptivecardjson_datetimepicker()
- ```
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Input.Date",
"id": "TryDate",
"placeholder": "Enter a date",
"value": "2022-01-01"
},
{
"type": "Input.Time",
"id": "TryTime",
"placeholder": "select time",
"value": "HH:MM"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
```
# AdaptiveCardDTP()
[Activity
Attachments = ${json(adaptivecardjson_datetimepicker())}
]
Thank you for your clarification.
The unified authoring canvas is in public preview in all PVA public cloud regions (only the GPT-based features, namely Conversation Boosters and Copilot, are limited to US environments).
The unified authoring canvas will be Generally Available (so production supported) in a matter of weeks now.