cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel_C
Level: Powered On

Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

Hi Team,

Trying to get client secure scores by running a flow, but hitting an issue with parsing the response.

I'm getting this on my "Parse secure scores" action.

 

[
{
"message": "Invalid type. Expected Integer but got Number.",
"lineNumber": 0,
"linePosition": 0,
"path": "value[0].currentScore",
"value": 76,
"schemaId": "#/properties/value/items/properties/currentScore",
"errorType": "type",
"childErrors": []
},

 

I used the sample payload returned from the "Return secure scores" action to generate the schema(below). Any ideas would be helpful.

 

 

Parse secure scores schema

{

"type": "object",

"properties": {

"@@odata.context": {

"type": "string"

},

"@@odata.nextLink": {

"type": "string"

},

"value": {

"type": "array",

"items": {

"type": "object",

"properties": {

"id": {

"type": "string"

},

"azureTenantId": {

"type": "string"

},

"activeUserCount": {

"type": "integer"

},

"createdDateTime": {

"type": "string"

},

"currentScore": {

"type": "integer"

},

"enabledServices": {

"type": "array",

"items": {

"type": "string"

}

},

"licensedUserCount": {

"type": "integer"

},

"maxScore": {

"type": "integer"

},

"vendorInformation": {

"type": "object",

"properties": {

"provider": {

"type": "string"

},

"providerVersion": {},

"subProvider": {},

"vendor": {

"type": "string"

}

}

},

"averageComparativeScores": {

"type": "array",

"items": {

"type": "object",

"properties": {

"basis": {

"type": "string"

},

"averageScore": {

"type": "integer"

},

"deviceScore": {

"type": "string"

},

"dataScore": {

"type": "string"

},

"identityScore": {

"type": "string"

},

"appsScore": {

"type": "string"

},

"seatSizeRangeUpperValue": {

"type": "string"

},

"categoryValue": {

"type": "string"

},

"seatSizeRangeLowerValue": {

"type": "string"

},

"infrastructureScore": {

"type": "string"

}

},

"required": [

"basis",

"averageScore",

"deviceScore",

"dataScore",

"identityScore",

"appsScore"

]

}

},

"controlScores": {

"type": "array",

"items": {

"type": "object",

"properties": {

"controlCategory": {

"type": "string"

},

"controlName": {

"type": "string"

},

"description": {

"type": "string"

},

"score": {

"type": "integer"

},

"total": {

"type": "string"

},

"count": {

"type": "string"

},

"on": {

"type": "string"

},

"expiry": {

"type": "string"

},

"adopted": {

"type": "string"

},

"Reviewed": {

"type": "string"

},

"AgentCnt": {

"type": "string"

},

"UserCnt": {

"type": "string"

},

"UserCnt3DES": {

"type": "string"

},

"AgentCnt3DES": {

"type": "string"

},

"NotScored": {

"type": "string"

}

},

"required": [

"controlCategory",

"controlName",

"description",

"score"

]

}

}

},

"required": [

"id",

"azureTenantId",

"activeUserCount",

"createdDateTime",

"currentScore",

"enabledServices",

"licensedUserCount",

"maxScore",

"vendorInformation",

"averageComparativeScores",

"controlScores"

]

}

}

}

}

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

Hi @Daniel_C ,

 

Please try to change Number to number.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team
Community Support Team

Re: Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

Hi @Daniel_C ,

 

Please try to modify schema and check if it helps:

20.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Daniel_C
Level: Powered On

Re: Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

Hi @v-bacao-msft ,

I made the suggested change.

Now I get the following.

 

For reference, this is the "Return secure scores" action.

Community Support Team
Community Support Team

Re: Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

Hi @Daniel_C ,

 

Please try to change Number to number.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Daniel_C
Level: Powered On

Re: Parsing JSON Response error - "message": "Invalid type. Expected Integer but got Number."

@v-bacao-msft ,

 

That fixed it, thanks mate.


Regards,

Dan

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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!

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: 155 members 3,722 guests
Please welcome our newest community members: