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 / Parse Json error for A...
Power Automate
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

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @ParmSandhu ,

     

    1. try removing  " "type": {}," from the code and check.

     

    Regards,

    Chandrashekhar

  • ChadVKealey Profile Picture
    1,393 on at

    Can you provide a screenshot of the error you see in a failed run? A close-up of it (rather than the whole screen) would be best. I honestly can't make anything out in the screenshot you posted; the text is too small and when I zoom in, it gets all pixelated.

  • ChadVKealey Profile Picture
    1,393 on at

    Also, are you certain that you selected a file upload question as the "Content" for the Parse JSON action? That schema only fits with "File upload" questions from a Microsoft Form. 

  • ParmSandhu Profile Picture
    17 on at

    Yes it is a file upload question on forms, but it is not required, think that was worth mentioning.

  • ParmSandhu Profile Picture
    17 on at

    error.PNG

  • ChadVKealey Profile Picture
    1,393 on at

    If you submit the form and attach/upload a file, does the flow work? If so, this behavior is expected. Basically, if you don't attach/upload a file, the response to that question is empty (null), which doesn't fit the schema that the action is using. If you don't plan to make the file upload required, you can add a condition that evaluates the response to that question and ONLY does the parse json (and other file-related steps) if that response is NOT null.

  • ParmSandhu Profile Picture
    17 on at

    Thanks Chad i started realizing that after running a couple of test runs and tried setting a condition. But am having issues with that as well because i am unsure of how to set a condition to tell the process that there is an attachment provided. i have posted another post here:

    https://powerusers.microsoft.com/t5/Building-Flows/Condition-Control-in-power-automate-for-Attachments-from-MS/m-p/952922#M133644

     

     

  • ParmSandhu Profile Picture
    17 on at

    so i have figured out the conditions and the parse json is passing now but now i am getting stopped at the "Get file meta data" im not sure what is causing this i am using the same steps as the video. here is the error.

     

    file metadata error.PNG

     

  • ChadVKealey Profile Picture
    1,393 on at

    That error means that it can't find the file that you're specifying in the input for the action. Can you provide a screenshot showing the input for the Apply to each loop and the Get file metadata action?

     

    Ensure that the input for Apply to each is the "Body" being output from the "Parse JSON" action.

     

    Also, make sure the input for the Get file metadata action is the "driveId"."id" (the dot/period in between is required!), also being output from the "Parse JSON" action.

  • ParmSandhu Profile Picture
    17 on at
    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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 780

#2
Valantis Profile Picture

Valantis 668

#3
Haque Profile Picture

Haque 601

Last 30 days Overall leaderboard