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 / Extract JSON from a Sh...
Power Automate
Unanswered

Extract JSON from a SharePoint List

(1) ShareShare
ReportReport
Posted on by 762

Hello Community,

 

I need to build a flow where I can extract data from a SharePoint list, but the information is in JSON

We have various information that is captured in the JSON for holidays, i.e. cancelled, adjustments, leave request

 

I've not done anything like this before and I would like to extract this information from SharePoint and potentially put it into another SharePoint list or send via email as I've had a request to get a summary of a teams holiday.

 

Can anyone help me please with Screenshots on how I can achieve this?

Screenshot 2020-10-21 120754.png

This is the information I want to extract

mainly start date, end date, comment and units (no of days taken)

 

Thank you in advance for any help / screen shots provided

Kind regards

Claire

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Use the Get Items from SharePoint action in Flow and then use the "Parse JSON" action against the value retrieved from the JSON column.

     

    That should give you the data you are after.

  • Verified answer
    fchopo Profile Picture
    8,003 Moderator on at

    Hello @ClaireAllen 

    You could parse the JSON value using the "Parse JSON" action, where the schema should be generated with some sample data like the one you shared:

    json_generate_from.png

     

    The generated schema is this one:

    {
     "type": "object",
     "properties": {
     "start": {
     "type": "string"
     },
     "end": {
     "type": "string"
     },
     "comment": {
     "type": "string"
     },
     "units": {
     "type": "string"
     },
     "GUID": {
     "type": "string"
     },
     "Type": {
     "type": "string"
     }
     }
    }

     

    In this case, we parse the JSON value stored in the "Title" column, and after that, we can access the values of the json data:

    parse_json_2.png

     

    Hope it helps!

    Ferran

     

     

     

  • ClaireAllen Profile Picture
    762 on at

    Hello @fchopo ,

    Thank you for the information and screen shots, it really does help,

    So I built the flow, but it does not seem to be the same, my Parse JSON are all Types and yours shows as the information I am looking for, i.e. Start Date, End Date etc

    Step 1.pngParse JSON.png

    This is how the Parse JSON is configured

    {
        "type""object",
        "properties": {
            "type": {
                "type""string"
            },
            "properties": {
                "type""object",
                "properties": {
                    "start": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "end": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "comment": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "units": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "GUID": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    },
                    "Type": {
                        "type""object",
                        "properties": {
                            "type": {
                                "type""string"
                            }
                        }
                    }
                }
            }
        }
    }

    Create Item.png

    The flow ran, but then I got an error

     

    Error Details.png

     

    If you are able to help where I went wrong, it would be really appreciated,

    Thanks again for the screen shots, as I felt I actually got somewhere

    Kind regards

    Claire

  • Verified answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    The issue you are running into is because the Generate from sample creates a schema where all the values are considered "string".  The problem is that when running the flow some of those values may be missing (null).  To fix it edit the JSON schema created from the sample data by changing the 

     "type": {
     "type": "string"
     }

    to 

     "type": {
     "type": ["string", "null"]
     }

     This will allow for that property to be null.  You may also need to edit the required field list at the bottom of the schema to remove non-required fields.

  • ClaireAllen Profile Picture
    762 on at

    Hello @Pstork1 

    Thank you for the information, I tried that and received an error message to enter valid JSON

     

    Kind regards

    Claire

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @ClaireAllen 

    Please, apply the solution by @Pstork1 to all the fields in the schema. It seems that some fields might have no value, and the Parse JSON action expects all of them to be informed. It should be something like this:

     

    {
     "type": "object",
     "properties": {
     "start": {
     "type": ["string", "null"]
     },
     "end": {
     "type": ["string", "null"]
     },
     "comment": {
     "type": ["string", "null"]
     },
     "units": {
     "type": ["string", "null"]
     },
     "GUID": {
     "type": ["string", "null"]
     },
     "Type": {
     "type": ["string", "null"]
     }
     }
    }

     

    Hope it helps!

    Ferran

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Can you show us the edited schema and the error message?

  • ClaireAllen Profile Picture
    762 on at

    Hello @Pstork1 , @fchopo 

     

    I've updated the Schema as mentioned

    Parse JSON.png

    {
        "type""object",
        "properties": {
            "start": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "end": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "comment": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "units": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "GUID": {
                "type": [
                    "string",
                    "null"
                ]
            },
            "Type": {
                "type": [
                    "string",
                    "null"
                ]
            }
        }
    }
     
    But I still get an error message
    Error details as requested
    Error Details.png
     
    Thank you for your assistance,
    Kind regards
    Claire
     
  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @ClaireAllen 

    By the screen captures you shared, it seems that the "approval JSON" column has different fields and values, so the structure is not always the same. For example, in a row there's a field called "comment", but in another one, this field is not provided.

     

    comment.png

     

    In order to work, the JSON structure should be always the same.

    Hope it helps!

    Ferran

  • ClaireAllen Profile Picture
    762 on at

    Thank you @fchopo 

    That is the case with my data,

     

    Thank you for your support

    Regards

    Claire

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