cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MarkBailey
Level: Power Up

Parse JSON for O365 Proxy Endpoints is failing

Based off this link: https://www.alanps1.io/office-365/call-o365-endpoints-web-service-and-return-the-latest-fqdns-part-2...

 

I'm trying to set up an e-mail alert for the changes to the endpoints - it works ok up to the point where it tries to Parse the JSON the second time before creating a filter to generate the HTML table.

 

I tried cutting out the HTML table and it worked this morning, so its only the Parse JSON 2, Filter Array, and Created HTML table that doesnt seem to be working in the flow.

 

HTML3 is set to GET: https://endpoints.office.com/changes/worldwide/@{items('Apply_to_each')['Latest']}?NoIPV6&clientrequ...

 

Parse JSON 2 (or 3 for me as I tried recreating it) is set to content: Body ('HTTP 3') and the payload is based off: https://endpoints.office.com/changes/worldwide/2018080200?NoIPV6&ClientRequestId=b10c5ed1-bad1-445f-...

 

On face value it looks ok but it doesn't like something and I can't see what I am missing to get this working I've recreated and copied and pasted based off the article several times so may have got myself in a bind now!  Thanks

 

Error when testing:

 
Start time: Jan 9, 04:35 PM (14 sec ago)
Duration:  00:00:05
Status: Failed
Error: Action 'Condition' failed
 
Apply to Each: 
ActionFailed. An action failed. No dependent actions succeeded.
 
Parse JSON 3: 
ValidationFailed.
Content: 
[
{
"id": 1,
"endpointSetId": 71,
"disposition": "Change",
"version": "2018072800"
},.......
"104.146.0.0/19",
"191.235.0.0/20"
]
}
}
]
 
Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"endpointSetId": {
"type": "integer"
},
"disposition": {
"type": "string"
},
"version": {
"type": "string"
},
"previous": {
"type": "object",
"properties": {
"expressRoute": {
"type": "string"
},
"serviceArea": {
"type": "string"
},
"category": {
"type": "string"
},
"required": {
"type": "string"
},
"tcpPorts": {
"type": "string"
}
}
},
"remove": {
"type": "object",
"properties": {
"urls": {
"type": "array",
"items": {
"type": "string"
}
},
"ips": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"add": {
"type": "object",
"properties": {
"effectiveDate": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"current": {
"type": "object",
"properties": {
"notes": {
"type": "string"
}
}
},
"impact": {
"type": "string"
}
},
"required": [
"id",
"endpointSetId",
"disposition",
"version"
]
}
}
 
Outputs: 
[
{
"message": "Invalid type. Expected String but got Null.",
"lineNumber": 0,
"linePosition": 0,
"path": "[50].current.notes",
"schemaId": "#/items/properties/current/properties/notes",
"errorType": "type",
"childErrors": []
},
{
"message": "Invalid type. Expected String but got Null.",
"lineNumber": 0,
"linePosition": 0,
"path": "[109].current.notes",
"schemaId": "#/items/properties/current/properties/notes",
"errorType": "type",
"childErrors": []
}
]
 
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey

I am looking at the schema error you have posted and your schema looks to have some diferent values to the working versions I have. Whilst I am only taking this from the error text, not your actual schema, can you please try to replace the schema for `Parse JSON 2` with the below and let me know if it helps?

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "integer"
            },
            "endpointSetId": {
                "type": "integer"
            },
            "disposition": {
                "type": "string"
            },
            "version": {
                "type": "string"
            },
            "remove": {
                "type": "object",
                "properties": {
                    "ips": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "add": {
                "type": "object",
                "properties": {
                    "effectiveDate": {
                        "type": "string"
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "previous": {
                "type": "object",
                "properties": {
                    "expressRoute": {
                        "type": "string"
                    },
                    "serviceArea": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "required": {
                        "type": "string"
                    },
                    "tcpPorts": {
                        "type": "string"
                    }
                }
            },
            "current": {
                "type": "object",
                "properties": {
                    "expressRoute": {},
                    "serviceArea": {},
                    "category": {},
                    "required": {},
                    "tcpPorts": {}
                }
            }
        },
        "required": [
            "id",
            "endpointSetId",
            "disposition",
            "version"
        ]
    }
}

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

Proud to be a Flownaut!


5 REPLIES 5
Community Support Team
Community Support Team

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey,

 

Could you please share a screenshot of the configuration of your flow and more details about your flow?

 

Best regrads,

Alice

MarkBailey
Level: Power Up

Re: Parse JSON for O365 Proxy Endpoints is failing

Not sure how best to upload screenshots of the flow as it'll be many, many screenshots as its really long... any tips would be welcome - here's a couple showing the affected areas config:

Annotation 2019-01-10 101948.jpgAnnotation 2019-01-10 102018.jpg

 

 

and the errors as well (which i've already put into the OP)Annotation 2019-01-10 102436.jpgAnnotation 2019-01-10 102502.jpg

 

The point of this flow is to check the MS O365 Endpoints version against a sharepoint list, then email me attachments of the JSON and a HTML table of the changes so I can monitor it using flow rather than manually and update with changes efficiently - its all outlined in the URL I used as a guide in the OP too if easier than me trying to sum it up in a nutshell

Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

Hi @MarkBailey

I am looking at the schema error you have posted and your schema looks to have some diferent values to the working versions I have. Whilst I am only taking this from the error text, not your actual schema, can you please try to replace the schema for `Parse JSON 2` with the below and let me know if it helps?

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "type": "integer"
            },
            "endpointSetId": {
                "type": "integer"
            },
            "disposition": {
                "type": "string"
            },
            "version": {
                "type": "string"
            },
            "remove": {
                "type": "object",
                "properties": {
                    "ips": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "add": {
                "type": "object",
                "properties": {
                    "effectiveDate": {
                        "type": "string"
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "previous": {
                "type": "object",
                "properties": {
                    "expressRoute": {
                        "type": "string"
                    },
                    "serviceArea": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "required": {
                        "type": "string"
                    },
                    "tcpPorts": {
                        "type": "string"
                    }
                }
            },
            "current": {
                "type": "object",
                "properties": {
                    "expressRoute": {},
                    "serviceArea": {},
                    "category": {},
                    "required": {},
                    "tcpPorts": {}
                }
            }
        },
        "required": [
            "id",
            "endpointSetId",
            "disposition",
            "version"
        ]
    }
}

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

Proud to be a Flownaut!


MarkBailey
Level: Power Up

Re: Parse JSON for O365 Proxy Endpoints is failing

That sorted it- Not sure why my schema didn't build correctly though - but that fixed it straight up!

 

Thanks

Super User
Super User

Re: Parse JSON for O365 Proxy Endpoints is failing

That's great news @MarkBailey

I can recall I had to rebuild my Schema a fair few times initially due to a similar error. Eventually it worked hence why I posted my schema.

Thank you for marking as the solution and for the thumbs up!

Alan


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

Proud to be a Flownaut!


Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fourthImage

Australia Summit

Travel to Melbourne and network with thousands of peers!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 27 members 4,249 guests
Please welcome our newest community members: