Hi,
I'm having problems with invalid types of data in my scenario and would be great if someone could give some hint.
My scenario is doing the following:
This is my table
And this is my flow
This is the content in the Parse JSON
[
{
"@odata.etag": "",
"ItemInternalId": "f2d1e93b-f1a2-42ad-886d-a1290d1156df",
"Name": "John",
"Value": "3",
"City": "London"
},
{
"@odata.etag": "",
"ItemInternalId": "91c8c219-5cbb-4fb8-b738-90074940e4d7",
"Name": "Jack",
"Value": "1",
"City": "Chicago"
},
{
"@odata.etag": "",
"ItemInternalId": "471edf2d-bd99-4cc5-b901-0549a9560b82",
"Name": "Jill",
"Value": "8",
"City": "Madrid"
}
]
And this is the JSON Schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"Name": {
"type": "string"
},
"Value": {
"type": "integer"
},
"City": {
"type": "string"
}
},
"required": [
"Name",
"Value",
"City"
]
}
}
The issue is that [Value] is expecting an integer but it is getting from the Table_Output array an string.
[
{
"message": "Invalid type. Expected Integer but got String.",
"lineNumber": 0,
"linePosition": 0,
"path": "[0].Value",
"value": "3",
"schemaId": "#/items/properties/Value",
"errorType": "type",
"childErrors": []
},
{
"message": "Invalid type. Expected Integer but got String.",
"lineNumber": 0,
"linePosition": 0,
"path": "[1].Value",
"value": "1",
"schemaId": "#/items/properties/Value",
"errorType": "type",
"childErrors": []
},
{
"message": "Invalid type. Expected Integer but got String.",
"lineNumber": 0,
"linePosition": 0,
"path": "[2].Value",
"value": "8",
"schemaId": "#/items/properties/Value",
"errorType": "type",
"childErrors": []
}
]
I've tried to use the formula int() to convert in the array to integer, but I can't target the correct column, but it is not working. I've also tried to change the schema to get a string (this is working) and then change Value to integer, but again it is not working. If I try a Compose to convert to integer value, it is not displaying the field "Value" in the Data Operation, only the {body}.
Any suggestion how I can convert a String to Integer there?
Many thanks
Thanks @v-litu-msft that was exactly what I was looking for. My scenario is working now.
Kind Regards
Hi @Sam4,
You could use the Select action to convert the String into Integer.
Run result:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Sam4 if you need to get an specific value yes what I did is exactly what you said I preparate my Squema to get the type I need. But see is you delete the type in your schema
"Value": {
"type": "integer"
},
Like this
"Value": {
},
You can use your value no matters what tipe of value you are going to receive even Null values, so then you can manage that result using expressions.
So for example if you want to use int values you can add a compose action an then add the expression int('HERE YOUR JSON PROPERTIE') to transform what you send into an integer value the same as Strig or other data type.
Thanks @ChristianAbata ,
If I take the Value out from the Schema, I still get it as a String in the Parse JSON Output. I think that I need to prepare the value before using the Schema or using an intermediate step that I am missing.
hi @Sam4 you can try by deleting the type
"Value": {
"type": "integer"
},
stampcoin
61
Michael E. Gernaey
47
Super User 2025 Season 1
rzaneti
31
Super User 2025 Season 1