WalkerMarema
6 years agoQrew Member
API_ImportFromCSV Question
Hi guys,
I've just started a new job as a Quickbase developer and I'm attempting to get familiar with the API doing my own personal projects with my builder account.
I've noticed something that I simply cannot wrap my head around and I suppose it's just some little trick that I'm not seeing.
I'm using the API_ImportFromCSV
I'm typing up the raw XML text using a python script and posting it to my table with a user token like so:
payload='''payload='''<qdbapi> <usertoken>VALID TOKEN INSERTED HERE</usertoken>
<records_csv>
<![CDATA[Date, Test Field, 12-10-2019,Hello1, 12-11-2019,Hello2, 12-12-2019,Hello3]]>
</records_csv>
<clist>8.16</clist>
<clist_output>8.16</clist_output>
<skipfirst>1</skipfirst>
</qdbapi>'''
I then post the payload and a funny thing seems to happen. The response indicates that 4 records have been added to the table in question (not 3 as you might think would occur based on my CSV above).
On the clist output, it consistently adds a blank record to my table. (A blank record meaning that both of the fields are blank). Here is a sample response:
<?xml version="1.0" ?>
<qdbapi>
<action>API_ImportFromCSV</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<num_recs_input>4</num_recs_input>
<num_recs_added>4</num_recs_added>
<rids>
<rid update_id="1576035474677">54</rid>
<fields rid="54" update_id="1576035474677">
<field id="8">1575936000000</field> <field id="16">Hello1</field> </fields>
<rid update_id="1576035474677">55</rid>
<fields rid="55" update_id="1576035474677"> <field id="8">1576022400000</field> <field id="16">Hello2</field> </fields>
<rid update_id="1576035474677">56</rid>
<fields rid="56" update_id="1576035474677"> <field id="8">1576108800000</field> <field id="16">Hello3</field> </fields>
<rid update_id="1576035474677">57</rid> <fields rid="57" update_id="1576035474677"> <field id="8"></field> <field id="16"></field> </fields>
</rids>
</qdbapi>
Note the red text here. Why on Earth would it be adding blank values to a new record before ending the list? Do I have a fundamental understanding here of CSV's?
Let me know. I'm very intrigued.
------------------------------
Walker Marema
------------------------------
I've just started a new job as a Quickbase developer and I'm attempting to get familiar with the API doing my own personal projects with my builder account.
I've noticed something that I simply cannot wrap my head around and I suppose it's just some little trick that I'm not seeing.
I'm using the API_ImportFromCSV
I'm typing up the raw XML text using a python script and posting it to my table with a user token like so:
payload='''payload='''<qdbapi> <usertoken>VALID TOKEN INSERTED HERE</usertoken>
<records_csv>
<![CDATA[Date, Test Field, 12-10-2019,Hello1, 12-11-2019,Hello2, 12-12-2019,Hello3]]>
</records_csv>
<clist>8.16</clist>
<clist_output>8.16</clist_output>
<skipfirst>1</skipfirst>
</qdbapi>'''
I then post the payload and a funny thing seems to happen. The response indicates that 4 records have been added to the table in question (not 3 as you might think would occur based on my CSV above).
On the clist output, it consistently adds a blank record to my table. (A blank record meaning that both of the fields are blank). Here is a sample response:
<?xml version="1.0" ?>
<qdbapi>
<action>API_ImportFromCSV</action>
<errcode>0</errcode>
<errtext>No error</errtext>
<num_recs_input>4</num_recs_input>
<num_recs_added>4</num_recs_added>
<rids>
<rid update_id="1576035474677">54</rid>
<fields rid="54" update_id="1576035474677">
<field id="8">1575936000000</field> <field id="16">Hello1</field> </fields>
<rid update_id="1576035474677">55</rid>
<fields rid="55" update_id="1576035474677"> <field id="8">1576022400000</field> <field id="16">Hello2</field> </fields>
<rid update_id="1576035474677">56</rid>
<fields rid="56" update_id="1576035474677"> <field id="8">1576108800000</field> <field id="16">Hello3</field> </fields>
<rid update_id="1576035474677">57</rid> <fields rid="57" update_id="1576035474677"> <field id="8"></field> <field id="16"></field> </fields>
</rids>
</qdbapi>
Note the red text here. Why on Earth would it be adding blank values to a new record before ending the list? Do I have a fundamental understanding here of CSV's?
Let me know. I'm very intrigued.
------------------------------
Walker Marema
------------------------------