Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we have file attachment within the adaptive card? #237

Open
aratigurav opened this issue Dec 18, 2019 · 3 comments
Open

Can we have file attachment within the adaptive card? #237

aratigurav opened this issue Dec 18, 2019 · 3 comments

Comments

@aratigurav
Copy link

No description provided.

@matthidinger
Copy link
Collaborator

If the file is available at a URL that the user can access, you could use an Action.OpenUrl with the url property set to the file location.

{
   "type": "Action.OpenUrl",
   "title": "Download",
   "url": "https://url-to-file"
}

You could also use markdown in a TextBlock to achieve the same thing:

{ 
   "type": "TextBlock",
   "text": "Click [here](https://url-to-file)To download"
}

@unlimitedduck
Copy link

@matthidinger looking at hooking up an adaptive card with Power Automate to send get a response from a user in Teams. What I'm after is can I have in the Adaptive Card a way for the user to attach an attachment and then the response via the adaptive card send the attachment to a SharePoint specific list row. Appreciate your time.

@pparthenhs
Copy link

Greeting dear community,

I hope you are doing well and continue coding 🚀

Our team and I, are facing the same issue.

Long story short, we have a service that generates report files, the types of those reports are :

  • images
  • Excels
  • CSV
    We would like to POST those reports on the Microsoft Teams on a channel.
    We are using the provided MS Teams webhook mechanism as it is documented here.

Regarding the image report, we created a POST on Teams' channel by transforming the image to base64 format. In more detail, we accomplish that by executing a POST HTTP request to the MS Teams webhook mechanism using the JSON below as the HTTP body.

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "type": "AdaptiveCard",
        "body": [
          {
            "type": "TextBlock",
            "text": "Hello, this is a message with an attached image file!",
            "wrap": false
          },
          {
            "type": "Image",
            "url": "{{base64}}",
            "wrap": true
          }
        ]
      }
    }
  ]
}

Is there any efficient way to include also the Excel and CSV reports in the POST on Teams' channel ??
(Without uploading those reports to the server and attaching them using URLs)

I remain at your disposal for any ideas, comments, or proposals.

Thank you and appreciate your time and effort in advance 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants