Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

Parse Json error for Attachments

(0) ShareShare
ReportReport
Posted on by 17

Im getting an Error for the parse Json for gathering the values of an attachment. i have posted a screenshot below. the flow wont get past the parse json

 

Parse Json Code:

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

 

 

 

 

parse json.png

 

  • WesleyM2 Profile Picture
    5 on at
    Re: Parse Json error for Attachments

    I added the condition and it worked to bypass JSON file upload. Thanks, now I just have to figure out how to get multiple files to upload instead of just the first one. 

  • SepPowProf Profile Picture
    12 on at
    Re: Parse Json error for Attachments

    I face the same issue. As a form collaborator, I am editing a shared flow to retrieve file metadata from a Shared Form and faces error. Manage to resolve it simply by getting the form/flow owner to allow my profile access to his/her OneDrive folder of that specific Shared Form. Test the flow and it works perfectly.

  • Michael_Yen Profile Picture
    77 on at
    Re: Parse Json error for Attachments

    Hi Chad

    Thank you for your explanation.

    It made sense.

    When I guided my colleague who is the Owner of the Form to create the Flow, the File upload and email was triggered successfully.

     

    I will see if  when she shares her OneDrive Folder containing the Form File Uploads, the original flow will work.

     

    Best regards

  • ChadVKealey Profile Picture
    1,393 on at
    Re: Parse Json error for Attachments

    @Michael_Yen , to be more specific, a user can only "get file metadata" on files to which they have at least read access. If it's a personal form that you did not create, then those files are saved into the OneDrive of the form's creator and unless they specifically shared the folder where the files are stored with you, then you don't have access. That is, someone might create a personal form and "share" it with you; that gives you access to the form, but not to the OneDrive folder where the form is storing uploaded files. 

     

    Now, if it's a group form, the files are stored in the group's SharePoint site, so any member of the group has access to the form itself as well as the files stored in SharePoint. 

     

    Regarding creation/ownership of the flow...it's a more complicated situation. Really, it's about the connections used in the flow and what access they have to OneDrive, SharePoint, etc.

     

    My examples assume that either it's a personal form and the flow is being created by (and run in the context of) the form's creator OR it's a group form and the flow is being created by (and run in the context of) a member of the group that owns the form. If you are sharing a form (personal or group) or sharing a flow, your results and experiences may vary.

  • Michael_Yen Profile Picture
    77 on at
    Re: Parse Json error for Attachments

    Referring to PamShandhu post  on ""Get file metadata" error message. I experienced the exact same issue. Which I suspect is due to Shared Forms and Shared Power Automate workflow.

    My conclusion was that the "Get file metadata" error will occur if

    1. The Form is not originally created by ourselves

    2. The Power Automate Flow is not originally created by ourselves

     

    When I used a Form created by myself, and used the Flow described by Chad, the Uploaded file gets into the Email successfully.

     

    If anyone has other solution, please share. Thank you

  • ParmSandhu Profile Picture
    17 on at
    Re: Parse Json error for Attachments

    Thank you so much for creating that. so it seems that i get a different input for "Get file metadata". i think its worth noting that i am working off a shared forms and shared power automate, where i am not the original owner. would that have any issues in the matter? the parse JSON passes perfectly now.

     

    Input for get file metadata

    {
        "method""get",
        "path""/datasets/default/files/b%25219bFCJ9HphUOgKe0yfEWfHubU0Dvw5wBNmvKSd3UNCog5kRNL5WzORLlbWzaSj8e8.014KXUNJEKVCYJ6VJLFNA3X3YDDGR7XQY2",
        "host": {
            "api": {
            },
            "connection": {
                "name""/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness/connections/shared-onedriveforbu-596ddbfc-814e-4887-9181-5fd2-8bee2210"
            }
        },
        "authentication": {
            "scheme""Key",
            "parameter""*sanitized*",
            "type""Raw"
        }
    }
  • ChadVKealey Profile Picture
    1,393 on at
    Re: Parse Json error for Attachments

    OK, I'm not sure where things are going wrong for you, but I recorded a short walk-through showing what the inputs & outputs should look like: https://www.screencast.com/t/wxXM8V4qcy 

  • ParmSandhu Profile Picture
    17 on at
    Re: Parse Json error for Attachments

    I did “get file meta data” and selected drive id and allowed power automate to create the apply to each loop function. I tried both ways and it still gave me an error.

  • ChadVKealey Profile Picture
    1,393 on at
    Re: Parse Json error for Attachments

    Something's not right with that input. Did you manually create the "Apply to each loop" and set the input, or did you add the "Get file metadata" action and select the "driveId" (letting Power Automate create the Apply to each loop) as shown here: https://youtu.be/amByVPsgUw8?t=388

  • ParmSandhu Profile Picture
    17 on at
    Re: Parse Json error for Attachments
    Get file metadata input
    {
        "method""get",
        "path""/datasets/default/files/b%25219bFCJ9HphUOgKe0yfEWfHubU0Dvw5wBNmvKSd3UNCog5kRNL5WzORLlbWzaSj8e8.014KXUNJEKVCYJ6VJLFNA3X3YDDGR7XQY2",
        "host": {
            "api": {
            },
            "connection": {
                "name""/providers/Microsoft.PowerApps/apis/shared_onedriveforbusiness/connections/shared-onedriveforbu-596ddbfc-814e-4887-9181-5fd2-8bee2210"
            }
        },
        "authentication": {
            "scheme""Key",
            "parameter""*sanitized*",
            "type""Raw"
        }
    }
    getfile.PNG

     

    it is the body from the parse json and the driveid is items('Apply_to_each')['driveId'] same with the id. and i do have a period between them.
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1