cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ea1409
Helper I
Helper I

send attachments from a sharepoint list and publish them in an adptive card to Teams

Hi has anyone been able to solve this? I am trying to send attachments from a sharepoint list and publish them in an adptive card to Teams. the attachments the only thing I am trying to recover is the name and a link so that the approver only has to click on it and go to the file from the adaptive card, thank you very much for any information

paso 1.PNGPaso 2.PNGpaso 3.PNG

2 REPLIES 2
v-LilyW-msft
Community Support
Community Support

Hi @Ea1409 

I set up a flow, you can refer to below screenshots to see if it helps.

vLilyWmsft_0-1642659794090.png

vLilyWmsft_1-1642659848881.png

The content of Message field.

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "TextBlock",
            "text": "File Request",
            "id": "Title",
            "spacing": "Medium",
            "horizontalAlignment": "Center",
            "size": "ExtraLarge",
            "weight": "Bolder",
            "color": "Accent"
        },
        {
            "type": "TextBlock",
            "text": "Please approval the request",
            "id": "acHeaderTagLine",
            "separator": true
        },
        {
            "type": "Input.ChoiceSet",
            "placeholder": "Select from these choices",
            "choices": [
                {
                    "title": "Agree",
                    "value": "Agree"
                },
                {
                "title": "Reject",
                "value": "Reject"
            }
            ],
            "id": "acPollChoices",
            "style": "expanded"
        }
    ],
    "actions": [
{
"type": "Action.OpenUrl",
"title": "Click here to see the file:@{item()?['DisplayName']}",
"url": "@{item()?['AbsoluteUri']}"
},
      {
            "type": "Action.Submit",
            "title": "Submit",
            "id": "btnSubmit"
        },
    ]
}

vLilyWmsft_2-1642660020074.png

Save and test.

When a new item is created,the attachment's filename and link will be add in an adptive card to Teams.

vLilyWmsft_3-1642660198823.pngvLilyWmsft_4-1642660249531.png

Hope the content above may help you.

Best Regards

If my answer helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ea1409
Helper I
Helper I

Hello, thank you very much for answering and sorry for the delay.
I wanted to ask you, there it creates an adaptive card once there is an attachment, for example there are several attachments in the attachment column, with this way, from what I see, send an adaptive card for each attachment that is in the list , this is so? If so, there would be inconveniences because my boss asks me to create only one adoptive card with all the attachments so that the approver approves or rejects them all at once and I can control this response, this idea is INCREDIBLY INTELLIGENT because I did not find another the same anywhere, but by chance I know how I can take a group of attachments, 2,3,4,5 etc to a single adptive card, I was doing this same process that you have, I get the attachments from the list and I get the content of the attachments and stored it in a JSON array but I still can't get it to work, I was trying to do something like the following, only from sharepoint but I still can't

 

https://youtu.be/Qb6ll0TwGyU?t=216

 

I thank you infinitely for this solution.

 

If a daptive card is generated for each attachment, I would have problems because the approver would have to answer me 6 times the approval and this goes to the flow, the states would be updated and many messes would be created, the ideal is that all the attachments be sent to a single adptive card as I mentioned for the approver to approve or not, so more or less how to show the video that I haven't managed to make it work yet.

adaptive card.PNG


Thank you again for responding and I am attentive to any information you can give me and I will be eternally grateful, a hug

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,021)