How to Get Adaptive card Responses in Sharepoint list using Azure Logic Apps?

Akshata 46 Reputation points
2022-03-29T17:26:04.85+00:00

I have created Adaptive card and SharePoint List.
currently I am able to post my message on teams but I want to save those responses in SharePoint List.
Could you please help me with the flow steps or any other solution.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,255 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,969 questions
{count} votes

Accepted answer
  1. Bruno Lucas 4,431 Reputation points MVP
    2022-04-04T08:11:05.813+00:00

    Looking into this: https://learn.microsoft.com/en-us/power-automate/overview-adaptive-cards, there is a "know issues" section that says:

    "It is not possible to collect data from Adaptive Cards unless they are created using one of the "wait for a response" actions. Adaptive Cards that don't wait return an error for all button actions except OpenURL"

    Are you using this one?:
    https://learn.microsoft.com/en-us/connectors/teams/#post-adaptive-card-and-wait-for-a-response

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Bruno Lucas 4,431 Reputation points MVP
    2022-04-05T00:03:08.903+00:00

    hi, I tried it with the response adaptive card . i guess what you mean is you are not being able to store the adaptive card input from the use that respond to it, right?
    I managed to get that but I wonder if you may be having some permission problem or a legit Microsoft problem. I tested that on a environment where I have global permissions for both teams and Azure. But could be a Microsoft issue. I just tried to help someone using the power automate version of teams and they found it was a issue with their environment. had to be addressed by Microsoft.
    Anyway, it this what you were trying to do: (my flow is just aquick example i quicly created to prove the point)

    I can add adaptive card fields to my SharePoint action

    189952-image.png

    my adaptive card code
    189810-image.png

    189942-image.png

    tested and now i can see the response
    189878-image.png

    I can see it in sharepoint
    189897-image.png

    forgive my rushed up sample, but that should be enough to prove the concept
    suggested troubleshooting:
    !.can you see the adaptive card fields at all? if not I can try to send you my adaptive card just for the test. there are some issues with this logic app control. it doesn't work with some adaptive card version. this worked for me: https://adaptivecards.io/samples/
    2. are you responding to the cards when they pop in team?
    3. do you see any red in the logic app execution?

    if everything seems normal but you can't see the fields, i suggest to investigate permissions or adaptive card version. if everything fails, raise a ticket with Microsoft

    0 comments No comments

  2. Bruno Lucas 4,431 Reputation points MVP
    2022-04-05T05:43:47.657+00:00

    hi,
    There is definitely something wrong with your adaptive card code. may take too long to figure, so I tried creating something similar with the editor and this one works for me.
    Suggestions: keep IDs without spaces

    when editing in https://adaptivecards.io/designer/, make sure you change "select host app" to "teams" and set version to 1.3

    190004-image.png

    ----------

    when assigning the fields to SharePoint, integer values won't be visible. you may need to change to "expression" and type string(). when you mouse over between the brackets you should see the integer value to select

    190023-image.png

    my template (this did work for me):

    {  
        "type": "AdaptiveCard",  
        "body": [  
            {  
                "type": "TextBlock",  
                "size": "Medium",  
                "weight": "Bolder",  
                "text": "Traffic Count for Falls Church Store"  
            },  
            {  
                "type": "Input.Text",  
                "placeholder": "How did your day go?",  
                "id": "info"  
            },  
            {  
                "type": "Input.Text",  
                "placeholder": "Traffic Count",  
                "id": "trafficCount"  
            },  
            {  
                "type": "Input.Text",  
                "placeholder": "Notes",  
                "id": "Notes"  
            },  
            {  
                "type": "ActionSet",  
                "actions": [  
                    {  
                        "type": "Action.Submit",  
                        "title": "Submit"  
                    }  
                ]  
            }  
        ],  
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",  
        "version": "1.3"  
    }  
      
    
    1 person found this answer helpful.

  3. Bruno Lucas 4,431 Reputation points MVP
    2022-03-31T09:30:11.773+00:00

    Hi, I think there are some challenges there that may make that a bit hard, if possible, at all

    Adaptive cards are generated in json and the rendered card you see in teams won't be passed to the logic app context

    the Teams controls context won't have the card parsed with the data. You would need to use "Compose" to store a version of the Adaptive Card with the Data, but still, even after that Sharepoint Lists don't have a column type that would display the rendered card. If you just want to store the json you can use a multiline column

    The Adaptive card can only pass the Teams link to the card in teams:

    188712-image.png

    188650-image.png

    {"id":"1648722334152","messageLink":"https://teams.microsoft.com/l/message/19:KdGuutWXuzLwttyumogtRvHDVl5HTJHxSesE1@thread.tacv2/1648718274152"}

    Compose can add the data to the card json. if that is enough than this should do

    188656-image.png

    0 comments No comments

  4. Akshata 46 Reputation points
    2022-04-04T07:02:38.097+00:00

    Hello @Bruno Lucas and @Mike Urnun ,
    Thank you for suggesting solutions.
    Still I am not able to crack what exactly is missing in my Azure Workflow.

    I am able to post message on teams and getting some of the response information saved on SharePoint List.
    I believe, there needs one more step in between "Post adaptive card and wait for Response" and "Create Item". this step should read response and save that on SharePoint. I checked all relevant SharePoint actions but not getting proper solution.

    Please let me know if any suggestions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.