web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert JSON Object TO...
Power Automate
Unanswered

Convert JSON Object TO Array

(0) ShareShare
ReportReport
Posted on by 13

 

I have the JSON below......

{
  "value": [
    {
      "Email""adele@xxxxxxxxxx.onmicrosoft.com"
    },
    {
      "Email""sydney@xxxxxxxx.OnMicrosoft.com"
    },
    {
      "Email""admin@xxxxxxxxxx.onmicrosoft.com"
    }
  ]
}

 

How can I get the array below from the JSON above?
[

      "adele@m365x685435.onmicrosoft.com"
      "sydney@M365x685435.OnMicrosoft.com"
      "jons@m365x685435.onmicrosoft.com"
]
Categories:
I have the same question (0)
  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    Hi @Harbie ,

     

    You could refer to screenshot below as below:

    1.png

    The schema in the Parse JSON as below:

    {
     "type": "object",
     "properties": {
     "value": {
     "type": "array",
     "items": {
     "type": "object",
     "properties": {
     "Email": {
     "type": "string"
     }
     },
     "required": [
     "Email"
     ]
     }
     }
     }
    }

     

    2.png

     

    The flow would run successfully as below:

    3.png

     

     

    Best Regards,

    Alice

     

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

  • Gyllentid Profile Picture
    894 on at

    hi @v-alzhan-msft is there a way to retain the property names in the array we create?

    From 

    {

        "Question1":"Some text",

        "Question2":"Some more text",

        "Question3":"Additional text"

    }

    Into this:

    [

        "Question1":"Some text",

        "Question2":"Some more text",

        "Question3":"Additional text"

    ]

  • Gyllentid Profile Picture
    894 on at

    I found a way for it. 

    split(replace(replace(string(outputs('ObjectName')),'{',''),'}',''),'","')
  • TsarCannon Profile Picture
    7 on at

    Wow man! 

  • TsarCannon Profile Picture
    7 on at

    wow man! Gonna try rn

  • Hill Profile Picture
    12 on at

    Hi
    My favorite way is to use a select action like this:

    Hill_1-1679478026221.png

    From:

    outputs('Compose_JSON_Array')?['value']

     

    Map: you have to switch to text mode, delete the brackets etc. and enter the Expression 

    item()?['Email']

     

    Like in the Picture:

    Hill_2-1679478049478.png


    This should result in this:

    Hill_3-1679478093309.png

  • bruno9d Profile Picture
    3 on at

    This is a much simpler and clever way I would say.

     

    Also If you need an array for each step inside a loop in parallel mode (the problem that I was solving) you need to use this option instead of looping and appending to an array variable because the array will be filled in parallel and you will get messed up values since it's a global variable and in contrast the Select action outputs a context variable for each loop interaction that works fine.

  • mgisbert Profile Picture
    71 on at

    I've done this and I realised the Append into array does not allow null values. How could this be done if some of the values coming from the JSON object can be null? 

    Thanks! 

  • Hill Profile Picture
    12 on at

    Hi mgisbert
    Have you tried my way of using the select action?
    For me this one seems to work even with null values

    Hill_0-1703163698990.png

     

  • zapower Profile Picture
    4 on at

    Before I create a new post, maybe someone here can help me.

    I also try to convert JSON Object to Array, i tired a lot of different approaches but everything seems to fail. 

     

    Here my JSON: 

    {
    "7ee5fb1d-fef6-483e-84e6-9b4d960f2d80": {
    "last_changed": 1703081408,
    "last_checked": 1704789923,
    "last_error": false,
    "title": "Keynote",
    "url": "http://abc.de",
    "viewed": true
    },
    "3022a04a-5248-4bc0-af78-39f0f48ae292": {
    "last_changed": 1704119225,
    "last_checked": 1705312960,
    "last_error": false,
    "title": "1Password",
    "url": "http://abc.de",
    "viewed": true
    },
    "5bd1d5b7-119a-4e90-862c-756b8e13c3fc": {
    "last_changed": 1703082231,
    "last_checked": 1705310059,
    "last_error": false,
    "title": "7-Zip",
    "url": "http://abc.de",
    "viewed": true
    },
    }
     
    Thank you for any input. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard