Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /oMSynd8aO40cYicQSRMWF
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,710 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 Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

#1
rpersad Profile Picture

rpersad 16

#2
David_MA Profile Picture

David_MA 10 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 8 Super User 2025 Season 1

Overall leaderboard
Loading started