Forum Discussion

KiranTauqir's avatar
KiranTauqir
Qrew Trainee
5 years ago

API_ImportFromCSV xml

I am trying to use the API_importfromCSV

but i dont know what will be endpoint *URL* for this- I've the data on a path,how do i write the columns and what will be format- 
I don't understand the API part :

records_csv

An aggregate containing the actual records you are importing.

<records_csv><br alt="" title="" name="" value="" type="" target="" rel="">&nbsp;&nbsp;&nbsp;<![CDATA[<br alt="" title="" name="" value="" type="" target="" rel="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;your, record, values, go, here<br alt="" title="" name="" value="" type="" target="" rel="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and, hopefully, here, as, well<br alt="" title="" name="" value="" type="" target="" rel="">&nbsp;&nbsp;&nbsp;]]><br alt="" title="" name="" value="" type="" target="" rel=""></records_csv><br alt="" title="" name="" value="" type="" target="" rel="">

For field format, usage, and any validation for fields of particular types, see API_AddRecord.



what if i am readingfrom a source excel file?


3 Replies

  • AustinK's avatar
    AustinK
    Qrew Commander
    If this is in JavaScript then create a literal csv variable. You do not need to bother with the field names in it, at least I don't worry about them. This would be a csv line that you could import. Just make sure the fields are in the same order as your clist.

    55,"Bluto","08/09/2019"

    You would just make that your csv variable in your code and do the importFromCSV. How are you trying to do this? JavaScript? Python? Post that and I can try and help some more. I always find it easier to use an SDK but it is possible to do it without fairly easily too.


    If you do not want to use an SDK or cannot and must use xml and do it the way QuickBase says then if you look at the documentation for API_importFromCSV it says this under the records_csv part, which should be more easily understood than the one you posted. I'm not sure what happened but it seems like you are looking at the html code of the page instead?

    <records_csv>
       <![CDATA[
          your, record, values, go, here
          and, hopefully, here, as, well
       ]]>
    </records_csv>
    • KiranTauqir's avatar
      KiranTauqir
      Qrew Trainee
      i;m tyring to do it with HTML get / post way
      or XML 

      i am using a tool Data virtuality, which allows me to write XML commands

      i have two options, either i add my table through a CSV direct, 
      or the table in my schema direct
      how do i print the tabale in an XML and insert it. 

    • AustinK's avatar
      AustinK
      Qrew Commander
      It sounds like the best way is to just import the csv itself. You just put the contents of your csv into the area that says:
       
      "your, record, values, go, here
       and, hopefully, here, as, well"

      If you don't have a way to insert the csv automatically you will have to do it manually every time you want an import. Unless I am misunderstanding this.