Forum Discussion

TestAccount's avatar
TestAccount
Qrew Trainee
6 years ago

Calling do query API does not return all lines in a field

I'm using the API to extract records from a table.  One of the fields in the table contains text that looks like this:

{
    "requireValidParent": "no",
    "projects": "56",
    "phus": {
        "massDelta": {
         "locations": "2,3,6,7",
            "min": "-0.05",
            "max": "0.01"
        }
    }


The API call only returns '{' for the text in this field.



2 Replies

  • Can you provide a little more info about what you're doing with your API Call and how your interpreting the XML response? I ran a few test doing a doQuery against a record that contains the string from above but the entire string came through for me - so any info related to the makeup of that field, and your method to parse the doQuery API response would be helpful to go further
  • Turned out to be an issue with Pyhton's&nbsp;<a target="" rel="" href="https://docs.python.org/3/library/xml.etree.elementtree.html#module-xml.etree.ElementTree" alt="" title="xmletreeElementTree Implementation of the ElementTree API" name="" value="" type="">xml.etree.ElementTree</a>.<br alt="" title="" name="" value="" type="" target="" rel="">The data I am pulling from QB is in JSON format&nbsp;-- the ElementTree library was failing to parse the multi-line structure -- it was returning only the characters before the first line break. &nbsp;Solution was to use the following command to parse the field: &nbsp;<br alt="" title="" name="" value="" type="" target="" rel="">' '.join( list( field.itertext() ) )<br alt="" title="" name="" value="" type="" target="" rel=""><br alt="" title="" name="" value="" type="" target="" rel="">