Skip to main content

Notifications

Copilot Studio - General
Answered

Attempt to obtain output from an Adaptive Card in PVA

(0) ShareShare
ReportReport
Posted on by 69

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:

Renad_0-1683031621220.png

 

 

Bot Framework Composer Dialog 

Renad_0-1683030939083.png

 

Renad_1-1683030955714.png

 

I also added Dialog Interface Outputs as suggested in a similar answer 

Renad_2-1683031023365.png

 

This is how it looks in PVA (I initialized a random variable as suggested by another user)

Renad_3-1683031067879.png

 

 

Categories:
  • Re: Attempt to obtain output from an Adaptive Card in PVA

    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.

     

  • Renad Profile Picture
    Renad 69 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    Thank you a lot for your help! It finally works!

  • Verified answer
    nikviz Profile Picture
    nikviz 242 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    you've to add the "=" as well.

    it is not assigning the value

  • Renad Profile Picture
    Renad 69 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    Hello there, I changed it to turn.activity.value.TryDate but it still doesn't work

    Renad_0-1683105550754.png

    Renad_1-1683105583049.png

     

     

  • Re: Attempt to obtain output from an Adaptive Card in PVA

    If you change the version to 1.2 it might work.

     

    Cheers

  • nikviz Profile Picture
    nikviz 242 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    hi @Renad 

     

    In the Set properties it is

    =turn.activity.value.TryDate

    =turn.activity.value.TryTime

  • Renad Profile Picture
    Renad 69 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    Hello there, I altered the suggested fields however it still doesn't work.

    Renad_3-1683101307434.png

     

    Renad_1-1683100413990.png

    Renad_2-1683100597141.png


    I also changed the ids in the card payload as suggested.

  • nikviz Profile Picture
    nikviz 242 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    Hi @Renad 

    I used sample code you provided and built this. Let me know if this helps.

    nikviz_0-1683045223935.png

     

    Just small changes to:

     

    nikviz_1-1683045287051.png

    set prompt configuration to 1:

    nikviz_3-1683045361286.png

     

     

    nikviz_2-1683045328664.png

     

    Dialog Interface:

     

    nikviz_4-1683045403601.png

     

    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())}
    ]

     

  • Renad Profile Picture
    Renad 69 on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    Thank you for your clarification. 

  • HenryJammes Profile Picture
    HenryJammes on at
    Re: Attempt to obtain output from an Adaptive Card in PVA

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard