web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Autoamte: Severa...
Power Automate
Answered

Power Autoamte: Several forms attachments to up chat

(0) ShareShare
ReportReport
Posted on by 18

Hi!

 

I have a Ms Form with one question asking for several attachments and I would like to post it together with the rest of the questions in a Group chat in Teams, where the attachments is linked OR you can find them as attachments to the message (preferer).

 

Please help me out with how to set-up the flow and if necessary what script to use. 

 

 

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Summertime2  you can create a flow with trigger "When new response is submitted" and save the attachments from the form to SharePoint and include it as link to message in teams.

  • Summertime2 Profile Picture
    18 on at

    Hi!

     

    I do not mange to get it to work with the link, would you mind showing me how to set-up the flow? 

     

    Thank you. 

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Summertime2  you can follow below steps:

    1. Submit one sample response of your form with attachments, this will create folder in onedrive to save attachment

    2. Add List Files in Folder action to your flow which has trigger of "When a new response is submitted"

    annajhaveri_0-1696591057180.png

    Here select folder using the folder icon in the action, navigate to Apps/Microsoft Forms/<Your form Name/ and now select the Question folder

     

    3. Add Initialize Variable action with variable name "Links" and of type "Array"

    annajhaveri_1-1696591236995.png

     

    4. Add Get File Content action and select Id in File parameter from Dynamic content

    annajhaveri_2-1696591294140.pngannajhaveri_3-1696591314980.png

    This will also add Apply to each action to your flow

    5. Add Create File (SharePoint) action to your flow, select your SharePoint site, folder

    annajhaveri_4-1696591400364.png

     

    Provide name in File Name and Body in File Content parameter from dynamic content

     

    6.  Add Append to Array Variable action to your flow and configure it as shown in below screenshot

    annajhaveri_5-1696591543121.png

     

    Replace https://domain.sharepoint.com/sites/site1 with your Site URL, Select Path and Display Name from your Create File dynamic content

     

    7. Then after Apply to each action outside of it, add "Post message in a chat or channel" action to your flow

    Then in the Message parameter, click on </> button in toolbar. Then use following expression in the Message

    join(variables('Links'),decodeUriComponent('%0A'))
  • Summertime2 Profile Picture
    18 on at

    Hi @annajhaveri,

     

    Thank you for your reply! 

     

    I manage to get the attachment to the correct Teams channel. However, the link still does not work, instead this message is posted in the channel:

    Summertime2_1-1696848800414.png

    Also, it is not possible to open the file that is added to the Teams folder.  

  • Summertime2 Profile Picture
    18 on at

    This is the flow that I set-up: 

     

    Summertime2_2-1696849026065.png

    Summertime2_0-1696851332754.png

     

    Summertime2_4-1696849073818.png

     

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Summertime2  in the message parameter, click on </> toolbar, then click on Add Dynamic Content. In Dynamic content popup, click on expression, paste the  expression there, then click ok, as shown in below screenshot

     

    annajhaveri_0-1696849155765.png

    annajhaveri_1-1696849195002.png

     

     

     

  • Summertime2 Profile Picture
    18 on at

    Hi @annajhaveri,

     

    I changed accordingly. However, when uploading one file in forms, several different files is added to the Teams folder, and a long list of links is posted in the chat..

    Summertime2_1-1696853701301.png

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Summertime2  in order to get only those files which were submitted in that specific instance of flow submissions please use following logic to get the files:

     

    1. Instead of using "List Files in Folder" action add "Parse JSON" action. Please make sure you have added "Get response details" to top of your flow

    In Parse json action, use the File parameter from dynamic content of Get REsponse action and use following schema json

    {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "name": {
     "type": "string"
     },
     "link": {
     "type": "string"
     },
     "id": {
     "type": "string"
     },
     "type": {},
     "size": {
     "type": "integer"
     },
     "referenceId": {
     "type": "string"
     },
     "driveId": {
     "type": "string"
     },
     "status": {
     "type": "integer"
     },
     "uploadSessionUrl": {}
     },
     "required": [
     "name",
     "link",
     "id",
     "type",
     "size",
     "referenceId",
     "driveId",
     "status",
     "uploadSessionUrl"
     ]
     }
    }

    annajhaveri_0-1696857357027.png

     

    2. Then add "Get file content" action, select the "id" value from dynamic content of Parse json. Note this will also add Apply to each action around it.

     

    annajhaveri_1-1696857545369.png

     

    Now add Create File and Append to array variable inside Apply to each action as described in my previous response.

     

    You can remove "List files in folder" and apply to each which was described in previous response.

     

     

  • Summertime2 Profile Picture
    18 on at

    Hi @annajhaveri,

     

    The files is added to the folder, but a Hyperlink is not created/shared in the chat. Instead the file name and location in a word format is shared (f.eks. /shared document/... *name of file*

     

    Thank you!

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Summertime2  you mean the link is not correctly displayed in chat? Can you share screens of append to array variable action configuration from your flow?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard