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 / Parsing JSON with Arra...
Power Automate
Unanswered

Parsing JSON with Array - First item is empty

(0) ShareShare
ReportReport
Posted on by 4

Hello to all,

New to Power Apps and JSON, so might by a very stupid question (but tried to do my homework and searched net for solutions first).

 

Use case: JSON is array of (LinkedIn) profiles, where jobs, school etc. are nested array's withing a profile. Getting out the "top level" tupels such as fullname, headline etc. is no problem.

 

Issue: Getting to the nested arrays fails, as the first element of the parsed JSON seems to be empty. Only the second element contains the first object? Attached the flow setup, the flow result with the first element (failing), and the second element (successful)

 

Question: How do I get rid of the first (empty) element? The JSON is "a given". I can't change that. All I control is the schema(s), and the flow.

 

SCREENSHOTS

Flow Input

Flow InputFlow Input

Body Error - First element is empty

Flow Output Error (empty first element)Flow Output Error (empty first element)

 

Output Success - Second element of Body

Flow Output SuccessFlow Output Success

INPUT JSON

[{"baseUrl":"","error":"Empty line","timestamp":"2021-12-09T11:58:41.226Z"},{"general":{"imgUrl":"https://someurl.com","fullName":"Jamie Oliver","headline":"President XYZ","location":"Mars","profileUrl":"https://www.xing.com/123","connectionDegree":"1st","mutualConnectionsText":"22 mutual connections: John Doe and 21 others","description":"","subscribers":"99","firstName":"Jamie","lastName":"Oliver","company":"XYZ","school":"University of Southern Mars"},"jobs":[{"companyUrl":"https://someurl.com","companyName":"XYZ","jobTitle":"President","dateRange":"Jan 2022 - Present · 1 yr","location":"Boom Town, Mars","logoUrl":"https://someurl.com"},{"companyUrl":"https://someurl.com","companyName":"ALPHA Bravo","jobTitle":"Managing Director","dateRange":"Jan 2015 - Dec 2021 · 7 yrs","location":"New York, USA","logoUrl":"https://someurl.com"}],"schools":[{"schoolUrl":"https://someurl.com","schoolName":"University of Southern Mars","degree":"Business Management","dateRange":"2002 - 2003","logoUrl":"https://someurl.com"},{"schoolUrl":"https://someurl.com","schoolName":"NYU","degree":"B.S. Marsology","dateRange":"1991 - 1997","logoUrl":"https://someurl.com"}],"details":{"linkedinProfile":"https://someurl.com","connectedOn":"September 13, 2015"},"skills":[{"name":"Gravitation","endorsements":22},{"name":"Marsology","endorsements":21}],"allSkills":"Gravitation and Marsology","query":"UID_string","timestamp":"2021-12-09T11:58:50.191Z"}]

SCHEMA USED

{
  "type""array",
  "items": {
    "type""object",
    "properties": {
      "baseUrl": {
        "type""string"
      },
      "error": {
        "type""string"
      },
      "timestamp": {
        "type""string"
      },
      "general": {
        "type""object",
        "properties": {
          "imgUrl": {
            "type""string"
          },
          "fullName": {
            "type""string"
          },
          "headline": {
            "type""string"
          },
          "location": {
            "type""string"
          },
          "profileUrl": {
            "type""string"
          },
          "connectionDegree": {
            "type""string"
          },
          "mutualConnectionsText": {
            "type""string"
          },
          "description": {
            "type""string"
          },
          "subscribers": {
            "type""string"
          },
          "firstName": {
            "type""string"
          },
          "lastName": {
            "type""string"
          },
          "company": {
            "type""string"
          },
          "school": {
            "type""string"
          }
        }
      },
      "jobs": {
        "type""array",
        "items": {
          "type""object",
          "properties": {
            "companyUrl": {
              "type""string"
            },
            "companyName": {
              "type""string"
            },
            "jobTitle": {
              "type""string"
            },
            "dateRange": {
              "type""string"
            },
            "location": {
              "type""string"
            },
            "logoUrl": {
              "type""string"
            }
          },
          "required": [
            "companyUrl",
            "companyName",
            "jobTitle",
            "dateRange",
            "location",
            "logoUrl"
          ]
        }
      },
      "schools": {
        "type""array",
        "items": {
          "type""object",
          "properties": {
            "schoolUrl": {
              "type""string"
            },
            "schoolName": {
              "type""string"
            },
            "degree": {
              "type""string"
            },
            "dateRange": {
              "type""string"
            },
            "logoUrl": {
              "type""string"
            }
          },
          "required": [
            "schoolUrl",
            "schoolName",
            "degree",
            "dateRange",
            "logoUrl"
          ]
        }
      },
      "details": {
        "type""object",
        "properties": {
          "linkedinProfile": {
            "type""string"
          },
          "connectedOn": {
            "type""string"
          }
        }
      },
      "skills": {
        "type""array",
        "items": {
          "type""object",
          "properties": {
            "name": {
              "type""string"
            },
            "endorsements": {
              "type""integer"
            }
          },
          "required": [
            "name",
            "endorsements"
          ]
        }
      },
      "allSkills": {
        "type""string"
      },
      "query": {
        "type""string"
      }
    },
    "required": [
      "timestamp"
    ]
  }
}
Categories:
I have the same question (0)
  • Verified answer
    mahoneypat Profile Picture
    1,720 on at

    You can add a Filter Array action before your Apply to each like so.  Then use the body of the Filter as the input to your Apply to each.

     

    mahoneypat_0-1639141755619.png

     

     

    Pat

  • Ulrich47 Profile Picture
    4 on at

    Thanks Pat! 

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard