You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This link is to a very short write up by Angela Zoss on how to query elements out of a table's data blob in the LDP. The formulas here work for simple data elements (elements shown in curly brackets) and array elements (enclosed within square brackets).

https://wiki.folio.org/pages/viewpage.action?pageId=36578061

Examples from the po_lines table. The element "cost" has values in curly brackets { }. These would be queried out by the simple "JSON_EXTRACT_PATH_TEXT (po_lines.data,'cost','xxxx')" command for each element.


The "locations" group elements are enclosed in square brackets AND curly brackets [{ }], so would need a more complex command to get each element:  JSON_EXTRACT_PATH_TEXT (JSON_ARRAY_ELEMENTS (JSON_EXTRACT_PATH (po_lines.data, 'locations')),'locationId') gets the locationId element. You would repeat this, substituting the name of each element needed at the end of the command (quantity, quantityElectronic, quantityPhysical).



Some objects in the data blob are even more complex - an example is the "details" stanza of the po_liines data blob. The information is nested inside curly brackets, square brackets and curly brackets { [ { } ] } The information at the link doesn't get into how to parse out those elements.



  • No labels