Attached to this KB article is a script to create the SQL Table Function ParseJson which allows for a SQL programmer to easily parse JSON data that has been imported into Counterpoint.


The custom fields that contain JSON data from an imported order are:

  • PS_DOC_LIN_EXT.USR_MAGE_PROD_OPTION_JSON


Example Response for ParseJSON


select * from dbo.ParseJSON('{"options":[{"This ticket is for me":"3 x No"},{"3 x Recipient Name (only if not for me)":"other name"},{"3 x Recipient Address":"other address"},{"3 x Recipient City":"other city"},{"3 x Recipient State":"other state"},{"3 x Recipient ZIP":"other zip"},{"3 x Recipient Phone":"other phone"}]}')