Skip to content

New QB Address field breakage  #2

Open

Description

@grahamdavies

I keep getting key errors when using query with a table that contains the new QB address fields. The 'hidden' fields for the address components do not have a label in fields[field.attrib['id']] and so you get a key error.

Could you also explain how queries are formed? I can't see how to map a QB query - such as - {'fid'.operator.'matching_value'} - onto a python dict.

Thanks

Activity

  1. nhynes commented on Jun 15, 2014

    @nhynes
    Collaborator

    I keep getting key errors when using query with a table that contains the new QB address fields.

    I'm not familiar with the new QB fields. Could you please describe the issue in more detail and perhaps include a link to relevant documentation?

    Could you also explain how queries are formed?

    To execute a query, just set the query string as the query key of the input dict. I would recommend using the SQL function, though. For instance, you could do

    SELECT * FROM table WHERE fid`operator`matching_value
    
  2. grahamdavies commented on Jun 15, 2014

    @grahamdavies
    Author

    Hi - thanks for the quick response - sorry I thought this was an official Quickbase API.

    The new address fields are quite unique. They are composed of multiple fields when output to CSV but in QB they appear as a single field with the ability to Google an address.

    http://quickbase.intuit.com/developer/knowledge-base/how-do-i-update-my-app-use-new-address-fields

    I did some tests and the Key Error occurs because the hidden fields do not have an 'id' when accessed via the method you use. If you add the following then it 'fixes' the issue but you can't tell which fields are which as far as I can see (e.g. postcode versus state versus street etc).

                if(field.tag == "f") and 'id' in field.attrib:
                    if field.attrib['id'] in fields:
                        temp[fields[field.attrib['id']]] = field.text
                    else:
                        bodge = "Address-%s" % ( field.attrib['id'] )
                        temp[bodge] = field.text
    

    I previously used the API from https://github.com/oysterhotels/quickbase, which seems to get the field names without spaces and in their original format - but this also breaks with the new addresses because the field for State/Region includes an illegal character '/' when trying to edit!

    Thanks for the SQL query - I've got that working now. I had assumed you would submit a 'Field Name'.XCT.'Value' style query via your query() function somehow.

  3. grahamdavies commented on Jul 3, 2014

    @grahamdavies
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions