cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Add Form Attachments to Planner Task

Hello,

I am very new to Power Automate, but I was able to use Forms to build a flow that creates a task in Planner when a Form is submitted.  I am able to Update the Task Details with all the information I need except the files that the submitter added to the form.  Instead, those files are moved to a folder somewhere that is not easy to access.

 

How do I get the files submitted with the form added to the Planner Task?

Thanks,

Jacob

27 REPLIES 27
rsaikrishna
Community Champion
Community Champion

@Anonymous 

 

The attachments submitted in the form are stored in the OneDrive. 

 

To copy the attachments from the MS Form, you can refer the following blog:

https://www.bythedevs.com/post/working-with-files-on-ms-forms-in-ms-power-automate

 

If you want to attach the attachments with the Planner Task, you can refer the following blog:

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Create-Planner-Task-and-Include-Attachments-From-Outlook-Email/ba-p/245121

Note: The above blog save the attachments from email but you can ignore it and use the logic to create planner task and include attachments.

 

Please let me know if you have any questions.

 

Regards

Krishna Rachakonda

If my reply helps resolving the issue, please mark the reply as Accepted Solution

 

Anonymous
Not applicable

Hello Krishna, I appreciate the feedback. Unfortunately, I'm not understanding the coding well enough to decipher how to use these examples on a MS Form instead of an email.  Planner Tasks have a place to put attachments so I would really like the attachments from the Form to end up there instead of having to look them up in the OneDrive folder.  Can you help clarify the logic behind this flow so that I might be able to understand how to convert?  Thanks.

@Anonymous 

 

I will create a sample and will share it with you shortly.

 

Regards

Krishna

Anonymous
Not applicable

Was this solved? Is there an example with screenshots you can post? I'm also confused about this and am having trouble translating all this Outlook instruction to Forms attachments.

Anonymous
Not applicable

Hi tojzanc, My IT department figured it out for me.  I'll attach photos of the flow they used.

Anonymous
Not applicable

jacobs1292_0-1595433526531.png

 

After scraping through SO MANY FORUMS and watching a bucket load of YouTube videos I have FINALLY worked out the solution to this and its no where near as complicated as some people made it out to be.

I am a novice to intermediate Power Automate user, so I'll try to keep this simple. I hope this helps someone! Took me 3 days to figure out.

 

1. OK, so first you want to set up capturing the form responses as per usual and I also like to grab the profile of the user who submitted the request so I can use it later on in the flow. I then have it create an item in a Sharepoint List (which I made columns for all my form responses).

Screen Shot 2020-10-14 at 10.34.03 am.png

 

2. Add the "Parse JSON" step (this is where I got confused). The Content is the attachment form field and the Schema (to make life easier) you can just copy and paste the below:

 

{
    "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"
        ]
    }
}

 

Screen Shot 2020-10-14 at 10.46.54 am.png

 

3. Next step is to add "Get File Content Using Path". (Don't worry about adding the Apply to Each, it will automatically apply this in a moment). Type in the file path to the OneDrive location. It will be /Apps/Microsoft Forms/***Form Folder Name Here***/Question/ then add the "name" dynamic content. It will automatically switch this to an Apply To Each step and apply the Body in the output section.

In this step I have it update the attachment to the sharepoint item (not sure if this step is crucial to then adding it to Planner, but I did it anyway!)

Screen Shot 2020-10-14 at 10.50.45 am.png

 

4. Add your next step outside of the Apply To Each box which is to "Create a Task" in Planner. Then add a 1 minute delay following the creation of the task.

Screen Shot 2020-10-14 at 10.59.48 am.png

 

5. Now add an "Apply to Each" and within this step, "Update Task Details". Now the part where it adds attachments! The reference alias will be the 'name' of the file and the reference resource is the 'link'. No weird expressions, formulas or complicated code - these are dynamic content options that will appear for you in the list! 🙂 

Screen Shot 2020-10-14 at 11.02.45 am.png

 

EXAMPLE:

Screen Shot 2020-10-14 at 11.06.47 am.png

***IMPORTANT*** If you require several people within your organisation to be able to access these attachments, you have to give them permission from the OneDrive folder to be able to view or edit these links!
Open your OneDrive App in a browser and navigate to the Form folder. You'll want to grant access to the 'Question' folder for that form. Click on the more options (...) and select 'Manage access'. Then, where it says "Direct Access" click on the "+" icon and type in the group or individual email addresses of the people you would like to grant the access too. I gave them edit permissions, but I'm pretty sure view permissions work also.

Screen Shot 2020-10-14 at 11.15.47 am.png

Screen Shot 2020-10-14 at 11.16.16 am.png

 

Now you're done! 🍾🥳

Thank you for the step-by-step explanation, I just started with power automation and I think this saves me a few days of work.

By the way: I omitted the sharepoint update step and it seems to work all the same.

 

you're welcome! glad I could help someone and minimise days of searching 😉

Hi,

 

I've been trying to attach a file this way, except it links it instead.

 

What does your link look like which causes it to attach instead of link?

 

I don't see a way to attach it.

 

Capture.PNG

 

Hey @juresti ,

 

Unfortunately, that part I couldn't work out. I too wanted the attachments, not a link to the attachment, and I tried several formulas to try and detect the type of attachment, but it wouldn't work for me. I just had to stick with links.

Thanks @dm_elementwa 

 

I thought I may had missed something.

 

By the way, I have also looked at the API access for planner which would expose all available interactions with the connector.

https://docs.microsoft.com/en-us/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=http

 

I didn't find an attachment method there either. It must exist though, because they let you attach manually. It could be it is just not documented.

At least that is what I think.

 

cwest204
Regular Visitor

This method works great if there is an attachment.  However, it fails when there is no attachment.  Has anyone else experienced this or knows how to solve for the "null" value?  When I attempt to put a control in for attachment, or even adding a question asking if they have an attachment I get the same error.  The error reads, "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of the template action 'Apply_to_each' at line '1 and column '7592' cannot reference action 'Parse_JSON' must either be in 'runAfter' path or within a scope action on the 'runAfter' path of action 'Apply_to_each' or be a Trigger.'.'.

Any ideas/help?

This was my solution to solve the problem of the flow failing when there is no attachment submitted.

 

After the steps for When a new response is submitted and Get response details, add a step to Initialize variable. Call it something like formsAttachments and set the type to Array.

 

Screen Shot 2021-08-26 at 1.19.19 PM.png

 

Add a condition step after initializing the variable to check if there's an attachment. Do this by using the formula empty() and inside the parentheses put the dynamic content for the title of your attachment question. Set this to check if empty is equal to false.

 

Screen Shot 2021-08-26 at 1.12.03 PM.png

 

Inside the If yes step, put the Parse JSON and Get file content using path steps. You'll also have to add a step to Append to array variable. The name will be the same name you used in the initialize variable step. Now for the Value field, this will change depending if you are using a Form that you created through your own account (OneDrive) or a Form you created through Teams (SharePoint).

 

If you created the Form through your own account, the files will be in OneDrive, so the Value will be:

{

"Name": "@{items('Apply_to_each')['name']}",

"ContentBytes": @{base64(body('Get_file_content_using_path'))}

}

 

If you created the Form through Teams, the files will be in SharePoint, so the Value will be:

{
"alias": "@{items('Apply_to_each')['name']}",
"resourceLink": @{items('Apply_to_each')['link']}
}

 

Screen Shot 2021-08-26 at 1.21.19 PM.png

 

Then add your Create a task and Update task details steps. In the References area, click the small T in the upper right corner to Switch to input entire array, click to Add dynamic content and select your formsAttachments variable.

 

Screen Shot 2021-08-26 at 1.36.55 PM.png

 

Screen Shot 2021-08-26 at 1.37.08 PM.png

 

And done! I hope this helped 🙂

 

Screen Shot 2021-08-26 at 1.04.25 PM.png

Thank you @VeronicaDeSalvo 

 

I stopped using planner partly because I couldn't add attachments.

 

Adding the attachments is the same as adding them to an Send an Email action.

 

I can see it is hard to figure it out on planner because of the name they use - Reference Alias. . . .

 

It is also good to learn there is a difference between Teams and other account attachment formats.

@dm_elementwa Thanks a bunch ! You made my day !!!

Thank you so much, this worked perfectly!  I skipped the whole create item in SP bit, as I don't need another list to save it in, and it still worked.  I think I was getting stuck where I wasn't adding an apply to each for the update task.

Hi KatLane, I'm really new to this but have somehow managed to create a flow that creates a Task from a Form and posts a message in the Chat section, however, mine is not picking up attachments, but I also do no need to save anything to SP, but just need to get the attachment from the form added/passed to the Task created. Would you mind sharing your Flow please?

Here's an image of my current flow.

 

Thank you!

Create task from form.jpg

@dm_elementwa I keep trying this but I keep getting a "404 -File or directory not found" error. It works fine for extracting/attaching the attachments from Forms to Lists. But when I try to attach the attachments to a Planner Task, I get this 404 error. I've tried multiple different ways, but keep getting the same result. Can someone please explain where I'm going wrong?

 

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,780)