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 Input
Body Error - First element is empty
Flow Output Error (empty first element)
Output Success - Second element of Body
Flow 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"
]
}
}