How to Determine Proxy Field Using API

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered
Using the QuickBase API, is it possible to determine if a field is a proxy field? I don't see anything in the XML back from API_GetSchema that indicates that. I see the <lusfid> tag which points a field back to the reference field, and the <lutfid> that points back the the field in the parent table, but nothing indicating a proxy field. Below is an example with Companies -> Contacts relationship, and three Contact fields as follows: Related Company (reference field) Company Name (lookup, proxy) Company - State (lookup) Nothing about Company Name in the xml below indicates it's a proxy field (i.e. no different than the field "Company - State"). What am I missing here? Thanks,Joe A.

<field id="32" field_type="float" base_type="float"> <label>Related Company</label> <nowrap>1</nowrap> <bold>0</bold> <required>0</required> <appears_by_default>0</appears_by_default> <find_enabled>1</find_enabled> <allow_new_choices>0</allow_new_choices> <sort_as_given>0</sort_as_given> <width>10</width> <carrychoices>0</carrychoices> <foreignkey>0</foreignkey> <unique>0</unique> <doesdatacopy>1</doesdatacopy> <fieldhelp/> <mastag>_DBID_COMPANIES</mastag> <decimal_places>0</decimal_places> <comma_start>0</comma_start> <numberfmt>0</numberfmt> <does_average>0</does_average> <does_total>0</does_total> <blank_is_zero>1</blank_is_zero> </field> <field id="33" field_type="text" base_type="text" mode="lookup"> <label>Company Name</label> <nowrap>0</nowrap> <bold>0</bold> <required>0</required> <appears_by_default>1</appears_by_default> <find_enabled>1</find_enabled> <allow_new_choices>0</allow_new_choices> <sort_as_given>0</sort_as_given> <carrychoices>1</carrychoices> <foreignkey>0</foreignkey> <unique>0</unique> <doesdatacopy>0</doesdatacopy> <fieldhelp/> <lutfid>6</lutfid> <lusfid>32</lusfid> <num_lines>1</num_lines> <maxlength>0</maxlength> <append_only>0</append_only> <allowHTML>0</allowHTML> </field> <field id="42" field_type="text" base_type="text" mode="lookup"> <label>Company - State</label> <nowrap>0</nowrap> <bold>0</bold> <required>0</required> <appears_by_default>0</appears_by_default> <find_enabled>1</find_enabled> <allow_new_choices>0</allow_new_choices> <sort_as_given>1</sort_as_given> <width>17</width> <carrychoices>1</carrychoices> <foreignkey>0</foreignkey> <unique>0</unique> <doesdatacopy>0</doesdatacopy> <fieldhelp/> <lutfid>17</lutfid> <lusfid>32</lusfid> <num_lines>1</num_lines> <maxlength>0</maxlength> <append_only>0</append_only> <allowHTML>0</allowHTML> </field>
Photo of Joe Acunzo

Joe Acunzo, Champion

  • 280 Points 250 badge 2x thumb

Posted 5 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
You have to embiggen your view of what the API is because this information is not in the QuickBase HTTP API documentation.

I just consider the whole internet my API.

In other words, you have to scrape the info out of the field settings page like this:

Pastie Database

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=267


One could put forward a good argument that a proxy field is not really part of the database schema but rather a user interface setting.

Embiggin is totally cromulent:

http://www.urbandictionary.com/define.php?term=Embiggen

ProTip: This is one reason why I rarely use any API wrapper like QuickBaseClient - in practical situations you often have to use non-API actions that QuickBaseClient does not wrap. So to avoid using two different calling convention I just use jQuery and pass the raw query parameters to the AJAX calls. It always works!
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
I could not help myself from making my own reusable API function $.getProxyField(dbid, fid):

Pastie Database

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=268


If you have any questions I promise to talk to you in the future about deferreds.

ProTip: Using this technique (The Be The API technique) you can extract any information from any QuickBase page!
Photo of Joe Acunzo

Joe Acunzo, Champion

  • 280 Points 250 badge 2x thumb
Dan,

Thanks for your response. I start with the QuickBase API first before "scraping" data off pages, but I have done my share of scraping. In your example, you look for an element named prxfid on the "modify field" page (a=mf&fid=NNN). However, when I examine the source of such a page, there is no element with that name (or id). The only thing I find of help is a div as follows:

<div>This field is the proxy field for the reference field <A HREF="bdbp638dp?a=mf&fid=32">Related Company</a> in this relationship.</div>


Where do you see an element named prxfid?

Thanks,
Joe A.