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 / How to access values i...
Power Automate
Answered

How to access values inside double bracket and/or remove extra bracket

(0) ShareShare
ReportReport
Posted on by 25

I'll start off with the statement of "maybe I'm going about this the wrong way".

I have the correct output of my flow, to a certain point.

 

The array/JSON is supposed to look like:

[
  {
    "USERID": "ID#####",
    "LN": "lastname",
    "FN": "firstname",
    "Org": "OrgCode",
    "Email": "email address"
  },
...(multiple more objects)
...
]

Instead, what I'm getting is:
 
[
  [
    {
      "USERID": "ID####",
      "LN": "lastname",
      "FN": "firstname",
      "Org": "OrgCode",
      "Email": "email address"
    }
  ],
... (again multiple entries)
...
]
 
The data is all correct; I've just got those extra brackets at the start and the end.  And because of that, I cannot process my next step, which is a select map with no keys, to then send to the output report, via an HTTP post.
 
The JSON is being built inside a apply to each loop from a select; that select produces the correct JSON, it's when I'm outside the apply to each, and gather them all together that it adds the extra brackets.

I'm guessing it's something terribly obvious that I'm just missing.
Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,551 Super User 2025 Season 2 on at

    can you use array(0) (conceptually) to get rid of the outer shell?

  • mithras Profile Picture
    25 on at

    Yes and no; Yes, it works, but that gives me only the first entry.

    Like, if I have as the input:

    [
      [
        {
          "USERID""ID###1",
          "LN""lastname1",
          "FN""firstname1",
          "Org""OrgCode1",
          "Email""email address1"
        }
      ],
    [
      [
        {
          "USERID""ID###2",
          "LN""lastname2",
          "FN""firstname2",
          "Org""OrgCode2",
          "Email""email address2"
        }
      ],
    [
      [
        {
          "USERID""ID###3",
          "LN""lastname3",
          "FN""firstname3",
          "Org""OrgCode3",
          "Email""email address3"
        }
      ]
    ]


    then outputs('FullList')[0]

    just gives me:

    [
      {
        "USERID""ID###1",
        "LN""lastname1",
        "FN""firstname1",
        "Org""OrgCode1",
        "Email""email address1"
      }
    ]
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    That sample nested array is invalid. Assuming you meant something like this:

    [
     [
     {
     "USERID": "ID###1",
     "LN": "lastname1",
     "FN": "firstname1",
     "Org": "OrgCode1",
     "Email": "email address1"
     }
     ],
     [
     {
     "USERID": "ID###2",
     "LN": "lastname2",
     "FN": "firstname2",
     "Org": "OrgCode2",
     "Email": "email address2"
     }
     ],
     [
     {
     "USERID": "ID###3",
     "LN": "lastname3",
     "FN": "firstname3",
     "Org": "OrgCode3",
     "Email": "email address3"
     }
     ]
    ]

     

    Then you could just use a Select as shown below. Note that the Compose contains the data shown above. The expression used is:

    first(item())

     

    grantjenkins_0-1675643304928.png

     

    The output of the Select would be:

    [
     {
     "USERID": "ID###1",
     "LN": "lastname1",
     "FN": "firstname1",
     "Org": "OrgCode1",
     "Email": "email address1"
     },
     {
     "USERID": "ID###2",
     "LN": "lastname2",
     "FN": "firstname2",
     "Org": "OrgCode2",
     "Email": "email address2"
     },
     {
     "USERID": "ID###3",
     "LN": "lastname3",
     "FN": "firstname3",
     "Org": "OrgCode3",
     "Email": "email address3"
     }
    ]


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • mithras Profile Picture
    25 on at

    Yeah, that was a copy paste error on here that I missed.

    Thanks; the first bit work.  Of course, it also revealed a flaw in the underlying data which I've now got to sort out, but isn't that always the way?

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 331 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

Last 30 days Overall leaderboard