Parse fields containing JSON data

Version 2



    This demonstrates one way to extract data from a field that contains JSON data (e.g. key/value pairs).

    The approach using a regex to pattern match on the key and then extract the value.


    Example Calculation:


    // Extract the value of a key/value pair from a JSON string


    // In this example we want the value of a key called highwaytype, eg:

    // {"highwaytype":"motorway"}


    // The regex is via

    // and tested with


    REGEXP_EXTRACT([JSON Column],'"highwaytype":"((\\"|[^"])*)"')


    // Here is a variation to get the value of a float, removing a trailing comma after the value using !,:

    // float(






    Inputs and Setup: (for table calculations, delete if not applicable)





    Partitioning and Addressing: (for table calculations, delete if not applicable)










    Related Functions:




    Further Reading/Examples: