cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Annabelle
Frequent Visitor

Help with figuring out which line to remove from Parse Json. User did not upload an attachment to form and it caused a failure.

Capture - Flow.PNG

 

Here is my Parse json.  A user fills our form and can include an attachment.  It they do not it fails.  If they do it succeeds.

 

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

Accepted Solutions

hi @Annabelle  what you need to do is manage a condition if the field Fileupload is empty or not.

see

part1.PNG

 

so if is empty go true part but if contains a file you can use parse json to get the link and the use that file



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Hi @Annabelle 

 

Can you try this:

{
    "type": ["array","null"],
    "items": {
        "type": ["object","null"],
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        }
    }
}

 

if that does not work try this:

{
    "properties": {
        "name": {
            "type": "string"
        },
        "link": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "type": {},
        "size": {
            "type": "integer"
        },
        "referenceId": {
            "type": "string"
        },
        "driveId": {
            "type": "string"
        },
        "status": {
            "type": "integer"
        },
        "uploadSessionUrl": {}
    }

}

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

4 REPLIES 4
Jcook
Super User
Super User

Hello,

Can you try:
{
"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": {}
}
}
}

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Annabelle
Frequent Visitor

Flow still fails at same step.

hi @Annabelle  what you need to do is manage a condition if the field Fileupload is empty or not.

see

part1.PNG

 

so if is empty go true part but if contains a file you can use parse json to get the link and the use that file



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

Hi @Annabelle 

 

Can you try this:

{
    "type": ["array","null"],
    "items": {
        "type": ["object","null"],
        "properties": {
            "name": {
                "type": "string"
            },
            "link": {
                "type": "string"
            },
            "id": {
                "type": "string"
            },
            "type": {},
            "size": {
                "type": "integer"
            },
            "referenceId": {
                "type": "string"
            },
            "driveId": {
                "type": "string"
            },
            "status": {
                "type": "integer"
            },
            "uploadSessionUrl": {}
        }
    }
}

 

if that does not work try this:

{
    "properties": {
        "name": {
            "type": "string"
        },
        "link": {
            "type": "string"
        },
        "id": {
            "type": "string"
        },
        "type": {},
        "size": {
            "type": "integer"
        },
        "referenceId": {
            "type": "string"
        },
        "driveId": {
            "type": "string"
        },
        "status": {
            "type": "integer"
        },
        "uploadSessionUrl": {}
    }

}

Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,955)