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 / MS Forms to SharePoint...
Power Automate
Unanswered

MS Forms to SharePoint list doesn't like image attachments

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

 

In my flow below, I am creating a SharePoint list item when a new response is submitted from MS Forms.

 

sudosaurus_0-1649411464991.png

sudosaurus_1-1649411494736.png
Next I am using this JSON schema to parse the attachments from MS Forms before being able to add them to my SharePoint list item. This is working for files such as .txt, .doc, .xls but not working for .jpg, .png - error at bottom of post.

 

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

sudosaurus_2-1649411515773.png

 

When I run the flow, I get thie error on the JSON action:

[
 {
 "message": "Invalid type. Expected Object but got Array.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "",
 "schemaId": "#",
 "errorType": "type",
 "childErrors": []
 }
]

As mentioned above, this is only occuring for image attachments.

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus ,

     

    The error shows that the output of your form's attachments is an array. But the schema of the 'parse Json' expects an object.

     

    Please copy the outputs of your attachments and paset it here.

    vxiaochenmsft_0-1649651779777.png

     

    Best Regards,

    Wearsky

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @v-xiaochen-msft 

     

    Here's my upload output:

    [{"name":"710Cr6Lot5L._AC_SL1500__Chris Cundy.jpg","link":"https://ondomain-my.sharepoint.com/personal/powerplatform_livewest_co_uk/Documents/Apps/Microsoft%20Forms/Application%20for%20a%20LiveWest%20Sponsored%20CIH%20Vocationa/Question/710Cr6Lot5L._AC_SL1500__Chris%20Cundy.jpg","id":"01UAWTK6PSUTPYNORUR5AKUFOY6NQMTMWQ","type":null,"size":115366,"referenceId":"01UAWTK6IANOEWSKQWSRHLL4Z3WG72JDM6","driveId":"b!lgB84gaIYEKwmDafJaNZ6teW0qwZWA1FkhEvTL8_nhTXJmYE0_v-RYpJfalqhfI8","status":1,"uploadSessionUrl":null}]

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus ,

     

    If you copy the output and paste it to the 'Parse Json' action ,will it work?

     

    Best Regards,

    Wearsky

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @v-xiaochen-msft 

    Well it's worked for the Parse JSON step however on the next step (Get file content - OneDrive for Business),
    I am getting this error:

    sudosaurus_0-1649692226540.png

     

    Unable to process template language expressions in action 'Get_file_content_of_MS_Forms_attachments' inputs at line '0' and column '0': 'The template language expression 'body('Parse_JSON_from_MS_Forms_file_upload_attachments')?['items']?['properties']?['id']' cannot be evaluated because property 'items' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard