i am receiving multiaple attachment from power apps in the form of a json file, after i receive it, i want to parse it and put it in an array. here is my flow so far:
the json file i recieved has:
[
{
name: "File Name"
contentBytes: "actual file bytes"
},
{
name: "File Name"
contentBytes: "actual file bytes"
},...et
]
schema:
{
"type": "object",
"items": {
"type": "array",
"properties": {
"Name": {
"type": "string"
},
"Value": {
"type": "string"
}
},
"required": [
"Name",
"Value"
]
}
}
when i reach this step in the flow it gives me the following error:
who can i fix this or is there a better method?
As I pointed out in my message the schema you are applying is incorrect for the JSON you are supplying. The schema says its an object, but the JSON you display starts with [ which is an array. Could you explain what you are trying to accomplish? That would help me point you in the right direction.
is there a way to turn an object into an array?
thank for the replay but am getting an error:
here is the power apps v2 flow:
its schema:
{
"type": "object",
"properties": {
"text": {
"description": "Please enter your input",
"title": "Input",
"type": "string",
"x-ms-content-hint": "TEXT",
"x-ms-dynamically-added": true
}
},
"required": [
"text"
]
}
its output:
[
{
\"contentBytes\":\
"iVBORw0KGgoAAAANSUhEUgAAAUwAAACYCAMAAAC4aCDgAAAAkFBMVEXaICj////cKzPaGyTgTlTYAADZFR/65ufYAA798PDiY2b+9fbjZmrcNDrZBhXxvL3YAAj30NLZCxjvr7DupqjcJS/YABHiWl7kbnH1ycr++fnpiIv31tf53+Dyvb/rlpneQkjmd3vsm57ngIPqj5LsnqHfRkzvra/mdXndOkDgTFHh...etc (too long to put here)"
"name\":\"download.png\"
},
{
\"contentBytes\":\"/9j/4QA+RXhpZgAASUkqAAgAAAABAJiCAgAZAAAAGgAAAAAAAABFYmVyc29sZSBQaG90b2dyYXBoeSBMTEMAAAAA/+wAEUR1Y2t5AAEABAAAADwAAP/hBYpodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDcuMi1jMDAwIDc5LjFiNjVhNzliNCwgMjAyMi8wNi8xMy0yMjowMTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM...etc (too long to put here)"
,\"name\":\"test-taking-tips.jpg\"
}
]
The JSON string you received is already an array. But the JSON you list in the post has some issues. The key names need to be in quotes and you are missing commas between the values. Here's a corrected sample.
[
{
name: "File Name"
contentBytes: "actual file bytes"
},
{
name: "File Name"
contentBytes: "actual file bytes"
}
]
Once the JSON is correct all you need is to do a Parse JSON with the right Schema. But the schema you are currently showing is incorrect. The second property should be "contentBytes" not "value". You don't need the step to add it to the array its already an array. This is the correct schema
{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"contentBytes": {
"type": "string"
}
},
"required": [
"name",
"contentBytes"
]
}
}
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2