Discussions

Expand all | Collapse all

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

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

    Posted 11-27-2018 21:15
    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.  RE: Calling do query API does not return all lines in a field

    Posted 11-28-2018 03:56
    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


  • 3.  RE: Calling do query API does not return all lines in a field

    Posted 11-29-2018 03:56
    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="">