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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PA and Microsoft Forms
Power Automate
Suggested Answer

PA and Microsoft Forms

(1) ShareShare
ReportReport
Posted on by 14
I am attempting to set up a form where a user enters their department and uploads an image.  Then PA picks up that image, uses the department to name it and puts it in a location on SharePoint.  
 
I tried using the form to upload the content, but found it wasn't uploading the image, but the response to the form in an odd way.  I had a little more success once I started going the route of looking into where those files get stored.  Using a OneDrive connector I've been able to upload the image when I manually put in the file name, but when I try to use Dynamic Content I am getting the following error.   The file exists, and the information looks the same as when I manually put the file and path in so I'm not sure where the issue is.
 
 
 
  "status"400,
  "message""The file id '/Apps/Microsoft Forms/Untitled form 1/Upload a Photo/IMG_1666_Brett Martindale 1.jpg' is not valid.",
  "source""api.connectorp.svc.ms"
 
 
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    @bmmartindale It's hard to offer any specific recommendations without seeing your full flow and the logic behind it. If you are using the new designer, toggle it off and click each action to expand it. Upload a screenshot of your flow in edit mode.

    In the meantime, you might be interested in these YT Tutorials:
     
    How to Add Microsoft Form File Uploads to a SharePoint List Item
    In this Microsoft Power Automate Tutorial I’m going to cover how to add file uploads to a SharePoint list item. First, I’ll show you how to get the file name and content from the File Uploads from your Microsoft Form, then I’ll show you how to add those files to a SharePoint item. 

    IN THIS VIDEO:
    ✓ Two types of MS Forms
    ✓ Where Microsoft Personal (OneDrive) Form File Uploads are Saved
    ✓ Where Microsoft Group Form File Uploads are Saved
    ✓ How to Add a File Upload Question to an MS Form
    ✓ How to get a Microsoft Form ID
    ✓ How to get a Microsoft Form Response
    ✓ How to Get the Dynamic Content Microsoft Form File Upload Content
    ✓ How to handle Single and Multiple Microsoft Form File Uploads
    ✓ How to use a Scope action to Organize and Group Your Flow Actions
    ✓ How to Get the File Content from an MS Form File Upload
    ✓ How to Collect All Files from Multiple File Upload Questions
    ✓ How to Handle MS Form Response When a File Isn’t Uploaded
    ✓ How to Attach an MS Form Single File Upload to a SharePoint List Item
    ✓ How to Attach Multiple MS Form File Uploads to a SharePoint List Item
    ✓ How to Attach MS Form File Uploads to an Email
     
    ---
     
    How to Get Microsoft Form File Uploads Attached to an Email 📧

    Are you stumped when it comes to handling a response without any file uploads?
     
    In this Microsoft Power Automate Tutorial I’m going to cover where file uploads from your Microsoft Forms are saved. I’ll also show you how attach the uploaded files to an email and how to dynamically name the files and customize the recipient of the email based on the selections made in your Microsoft Form. I will also cover how to handle responses that don’t include any file uploads.
     
    IN THIS VIDEO:

    ✓ Two types of MS Forms
    ✓ Where Microsoft Personal (OneDrive) Form File Uploads are Saved
    ✓ Where Microsoft Group Form File Uploads are Saved
    ✓ How to Add a File Upload Question to an MS Form
    ✓ How to get a Microsoft Form ID
    ✓ How to get a Microsoft Form Response
    ✓ How to Get the Dynamic Content Microsoft Form File Upload Content
    ✓ How to handle Single and Multiple Microsoft Form File Uploads
    ✓ How to use a Scope action to Organize and Group Your Flow Actions
    ✓ How to Get the File Content from an MS Form File Upload
    ✓ How to Collect All Files Uploaded to a MS Form and Attach to an Email
    ✓ How to Handle MS Form Response When a File Isn’t Uploaded
    ✓ How to Create an Email Key
    ✓ How to Send an Email to a Specific Recipient Based on Form Selection
    ✓ How to Create a Dynamic Output Based on Form Selection
     

    If you still run into issues while building your flow, share screenshots of your full flow and the logic behind it.

    Upload a screenshot of your flow in edit mode. If you are using the new designer, toggle it off and click each action to expand it.

     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!
    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • bmmartindale Profile Picture
    14 on at
    Here are the screenshots for the flow.
  • Suggested answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    You have to use Identifier from List files in folder for Get file content and Delete file steps
     
    see below pic( as your reference).
     
     
  • Suggested answer
    Riyaz_riz11 Profile Picture
    3,878 Super User 2025 Season 2 on at
    Hi,
     

    The issue you're encountering is common when working with Microsoft Forms file uploads and OneDrive connectors. The file ID format from Forms isn't compatible with standard OneDrive operations. Here are several solutions:

    Solution 1: Use "Get file content" then "Create file" (Recommended) 

    Instead of trying to use the file ID directly, get the content first: 


    1. Get file content using path

      • Connector: OneDrive for Business

      • Action: "Get file content using path"

      • File Path: Use the dynamic content from Forms (the full path)

    2. Create file in SharePoint

      • Connector: SharePoint

      • Action: "Create file"

      • Site Address: Your SharePoint site

      • Folder Path: Your target folder

      • File Name: Use department name + ".jpg" (or extract extension)

      • File Content: Output from step 1 

      •  

    Solution 2: Parse the File Information Correctly 

    The Forms file upload returns a complex object. You need to extract the right properties: 


    1. Add "Parse JSON" action

      • Content: The file upload field from Forms

      • Schema (approximate):

      •  
       
      json
      {
          "type": "array",
          "items": {
              "type": "object",
              "properties": {
                  "name": {"type": "string"},
                  "link": {"type": "string"},
                  "id": {"type": "string"},
                  "type": {"type": "string"},
                  "size": {"type": "integer"}
              }
          }
      }

    2. Use the parsed values in your subsequent actions

    3.  

    Solution 3: Direct SharePoint Upload (Bypass OneDrive) 


    1. Get file content using path

      • Use the Forms file path as-is

      • Connector: OneDrive for Business

    2. Create file directly in SharePoint

      • Skip OneDrive operations entirely

      • Use department name for file naming

      •  

    Solution 4: Use Microsoft Graph API 

    If the above don't work, use an HTTP action with Graph API:


    1. HTTP Action

      • Method: GET

      • URI: https://graph.microsoft.com/v1.0/me/drive/items/{file-id}/content

      • Authentication: Use the connection


      •  
    2. Create file with the response body

    3.  

    Debugging Steps:


    1. Add "Compose" actions to see what data you're actually getting:

      • Compose 1: The entire Forms response

      • Compose 2: Just the file upload field

      • Compose 3: The file path/ID you're trying to use

    2. Check the file path format - it should look like:

      • Correct: /Apps/Microsoft Forms/Form Name/Question Name/filename.jpg

      • Your error shows this format, so the path looks right

    3. Try using "Get file metadata using path" first to verify the file exists and get proper metadata

    Complete Working Flow Structure:

     
    1. Forms trigger
    2. Initialize variable: Department Name (from form)
    3. Initialize variable: File Extension (extract from filename)
    4. Compose: Test file path from Forms
    5. Get file content using path (OneDrive)
    6. Create file (SharePoint)
       - Name: [Department].[Extension]
       - Content: File content from step 5

    File Naming Best Practice:

    Concat(outputs('Department_Variable'), '_', formatDateTime(utcnow(), 'yyyyMMdd'), '.jpg')
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
  • bmmartindale Profile Picture
    14 on at
    @stampcoin  Hi, 
     
    Thanks for the info, being somewhat inexperienced with the platform, I'm not sure if this was the expected behavior when changing out the Value for ID.  If so I get an error when I try to save it.
  • bmmartindale Profile Picture
    14 on at
     
    The Document ID doesn't exist in forms.  I tried pulling the information directly from the form and was able to get a file, but found that just gave me unusable information, but did include a link to my OneDrive, which is where I hit on the idea of pulling the pictures from my OneDrive and putting them into SharePoint.
     
    Solution 1 - Forms itself doesn't give me a path for the file, so I am not sure what you mean by "File Path: Use the dynamic content from Forms (the full path)"
     
    Solution 2 - I'm not sure how I would pull the link from the file Forms gives me.  I can manually, but kind of defeats the purpose.
     
    Solution 3 - This is where I started, but when I try to use the response for the question where the person uploaded the picture I get this kind of file, not the image
    [{"name":"IMG_1669_Brett Martindale 4.jpg",
        "link":"https://.../Apps/Microsoft%20Forms/Untitled%20form%201/Upload%20a%20Photo/IMG_1669_Brett%20Martindale%204.jpg",
        "id":"013HQ3GTLVMRVGKDJ5UVD335AHWTFB3GWL",
        "type":null,
        "size":332867,
        "referenceId":"013HQ3GTKKOW33UUE62RGJUI4GB6HOBF5B",
        "driveId":"b!nYd1R88KFEOJ7CPo",
        "status":1,
        "uploadSessionUrl":null
    }]
     
    Solution 4 - Would require a level of licensing I don't have access to at the moment.
  • Suggested answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Maybe share my flow will be better.
    I ignore the trigger and the Get response details
     
    1.After Get response details, Add Compose,
    Inputs=
    first(json(outputs('Get_response_details')?['body/rcbefe71e72a2426f9dd7985e52ae0698']))
    Replace with your attachment field from step Get_response_details.
     
    2. Add another Compose, call it Compose – FilePath,
    Inputs=
    uriComponentToString(
      substring(
       outputs('Compose')?['link'],
        indexOf(outputs('Compose')?['link'], '/Apps/')
      )
    )
    3. Add Get file content using path, from OneDrive.
    File path:
    @outputs('Compose_–_FilePath')
     
    4. Add Create File from SharePoint
    File Name: 
    @outputs('Compose')?['name']
    File Content:
    @body('Get_file_content_using_path')
     
     
    Whole flow screen shot.
     
     
     
     
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard