Skip to main content

Notifications

Community site session details

Community site session details

Session Id : lLKbleQ0yz8Zum/8B/D144
Power Automate - General Discussion
Answered

Create a valid JSON from append to array?

Like (0) ShareShare
ReportReport
Posted on 6 Jul 2023 11:27:06 by 1,095

I want to parse json the response from a array variable.

 

I create an array this way

Oskarkuus_0-1688642654585.png

 

 

I get the response like this:

 

[
 "[filename: l1,fileextension: l1.jpg,fileID:281]",
 "[filename: l2,fileextension: l2.jpg,fileID:282]",
 "[filename: l5,fileextension: l5.jpg,fileID:283]",
 "[filename: l3,fileextension: l3.jpg,fileID:284]",
 "[filename: l1,fileextension: l1.jpg,fileID:281]",
 "[filename: l2,fileextension: l2.jpg,fileID:282]",
 "[filename: l5,fileextension: l5.jpg,fileID:283]",
 "[filename: l3,fileextension: l3.jpg,fileID:284]",
 "[filename: l1,fileextension: l1.jpg,fileID:281]",
 "[filename: l2,fileextension: l2.jpg,fileID:282]",
 "[filename: l5,fileextension: l5.jpg,fileID:283]",
 "[filename: l3,fileextension: l3.jpg,fileID:284]",
 "[filename: l1,fileextension: l1.jpg,fileID:281]",
 "[filename: l2,fileextension: l2.jpg,fileID:282]",
 "[filename: l5,fileextension: l5.jpg,fileID:283]",
 "[filename: l3,fileextension: l3.jpg,fileID:284]"
]

 

 

But when i try to create a parse json and try to create a schema

power automate generate this schema:

 

 

{
 "type": "array",
 "items": {
 "type": "string"
 }
}

 

 

And that schema does not give me any dynamic options.

How to generate a standard json schema from my array?

 

Categories:
  • S-Venkadesh Profile Picture
    636 Super User 2025 Season 1 on 06 Jul 2023 at 12:45:13
    Re: Create a valid JSON from append to array?

    Hi @Oskarkuus ,

    Create a File object as below, add it to Array an then generate the schema from the output.
    {
    "filename": "abc",
    "fileId": "001"
    }

    SVenkadesh_0-1688647210100.png

     

    you schema will look like this:

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "filename": {
                    "type""string"
                },
                "fileId": {
                    "type""string"
                }
            },
            "required": [
                "filename",
                "fileId"
            ]
        }
    }

     

    I hope this information is helpful. If it is, please consider giving a thumbs up.

     

    Best regards,

    Venkadesh Sundaramurthy

  • Verified answer
    Chriddle Profile Picture
    7,669 Super User 2025 Season 1 on 06 Jul 2023 at 12:26:12
    Re: Create a valid JSON from append to array?

    Your appended value is a string, that's why you don't get the intended schema.

    Replace [ and ] with { and } and set the " accordingly

    to append an object like this:

     

    {"filename": "Value_from_dynamic _content1", "fileextension": "Value_from_dynamic _content2", "fileID": "Value_from_dynamic _content3"}

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started