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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Parse JSON for HTML Table

(0) ShareShare
ReportReport
Posted on by 36

Hi, been trying to get my first flow going but I'm stuck. I've found similar issues here but I've failed to resolve my issue with the help in those.

 

I'm extracting e-mail attachments and saving them in Sharepoints Teams files tab. Then sending a message as the Flow bot with the contents of the e-mail. (Sadly we can't just forward to channel).

 

I'm stuck when I'm trying to parse the json containing the attachment (one loop for each attachment). Disregard the post message to teams, it's not relevant.

firefox_GN6X5RQ0LB.png

 

When I run this I get a error in JSON Parser: "Invalid type. Expected Object but got Array."

If I change the JSON schema "type object" to "type array" I can't select my properties anymore in the HTML Table.

 

firefox_6QxT4fxQWd.png

 
This is the schema I generated from the sample output from compose: (Can't make it let me post this in code sample for some reason)

 

{
 "type": "object",
 "properties": {
 "ItemInternalId": {
 "type": "string"
 },
 "ID": {
 "type": "integer"
 },
 "Modified": {
 "type": "string"
 },
 "Editor": {
 "type": "object",
 "properties": {
 "Claims": {
 "type": "string"
 },
 "DisplayName": {
 "type": "string"
 },
 "Email": {
 "type": "string"
 },
 "Picture": {
 "type": "string"
 },
 "Department": {
 "type": "string"
 },
 "JobTitle": {
 "type": "string"
 },
 "@odata.type": {
 "type": "string"
 }
 }
 },
 "Editor#Claims": {
 "type": "string"
 },
 "Created": {
 "type": "string"
 },
 "Author": {
 "type": "object",
 "properties": {
 "Claims": {
 "type": "string"
 },
 "DisplayName": {
 "type": "string"
 },
 "Email": {
 "type": "string"
 },
 "Picture": {
 "type": "string"
 },
 "Department": {},
 "JobTitle": {},
 "@odata.type": {
 "type": "string"
 }
 }
 },
 "Author#Claims": {
 "type": "string"
 },
 "OData__DisplayName": {
 "type": "string"
 },
 "{Identifier}": {
 "type": "string"
 },
 "{IsFolder}": {
 "type": "boolean"
 },
 "{Thumbnail}": {
 "type": "object",
 "properties": {
 "Large": {
 "type": "string"
 },
 "Medium": {
 "type": "string"
 },
 "Small": {
 "type": "string"
 }
 }
 },
 "{Link}": {
 "type": "string"
 },
 "{Name}": {
 "type": "string"
 },
 "{FilenameWithExtension}": {
 "type": "string"
 },
 "{Path}": {
 "type": "string"
 },
 "{FullPath}": {
 "type": "string"
 },
 "{IsCheckedOut}": {
 "type": "boolean"
 },
 "{VersionNumber}": {
 "type": "string"
 },
 "@odata.etag": {
 "type": "string"
 }
 }
}

 

 

This is the input to Parse JSON:

 

[
{
"@odata.etag": "\"1\"",
"ItemInternalId": "67",
"ID": 67,
"Modified": "2020-04-26T09:29:37Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|REMOVED",
"DisplayName": "REMOVED",
"Email": "REMOVED",
"Picture": "LINK",
"Department": "",
"JobTitle": ""
},
"Editor#Claims": "i:0#.f|membership|REMOVED",
"Created": "2020-04-26T09:29:37Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|REMOVED",
"DisplayName": "REMOVED",
"Email": "REMOVED",
"Picture": "LINK",
"Department": null,
"JobTitle": null
},
"Author#Claims": "i:0#.f|membership|REMOVED",
"OData__DisplayName": "",
"{Identifier}": "Shared%2bDocuments%252fGeneral%252f2020-04-26T11_29_30-AviseringarTeams.docx",
"{IsFolder}": false,
"{Thumbnail}": {
"Large": "LINK",
"Medium": "LINK",
"Small": "LINK"
},
"{Link}": "LINK",
"{Name}": "2020-04-26T11_29_30-AviseringarTeams",
"{FilenameWithExtension}": "2020-04-26T11_29_30-AviseringarTeams.docx",
"{Path}": "Shared Documents/General/",
"{FullPath}": "Shared Documents/General/2020-04-26T11_29_30-AviseringarTeams.docx",
"{IsCheckedOut}": false,
"{VersionNumber}": "1.0"
}
]

 

I only need "FilenameWithExtension" and "Link". Hoping to get some help

I have the same question (0)
  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: Parse JSON for HTML Table

    Hi!

    My suggestion is to get rid of the 'Parse JSON', assign your array variable as 'Create HTML table' input and assign the following expressions as 'Values' for current Header Names:

     

    item()?['{FilenameWithExtension}']
    item()?['{Link}']

     

    If you are not familiar with expressions yet, please follow these steps

    https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

     

    Hope this helps

  • J-And Profile Picture
    36 on at
    Re: Parse JSON for HTML Table

    Thank you so much! My next step is clearly reading up on expressions in flow!

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

Coming soon: forum hierarchy changes

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
Tomac Profile Picture

Tomac 532 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 461 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 256

Last 30 days Overall leaderboard