APIs & Domo Developer

APIs & Domo Developer

DOMO Import Problems

I am importing data using the API, Java.

I am only seeing 1 row of data!

 

Am I not ending the line properly?

What am I missing? What aren't my remaining rows of data getting loaded?

 

Here is my code:

  1. String csvInput =
    "\""+contact.getFirstName()+"\","+
    "\""+contact.getLastName()+"\","+
    "\""+contact.getPhone()+"\","+
    "\""+contact.getCompany()+"\","+
    "\""+contact.getEmail()+"\","+
    "\""+contact.getID()+"\","+
    "\""+contact.getDegree()+"\","+
    "\""+contact.getBadge()+"\","+
    "\""+contact.getMailStreet1()+"\","+
    "\""+contact.getMailStreet2()+"\","+
    "\""+contact.getMailCity()+"\","+
    "\""+contact.getMailState()+"\","+
    "\""+contact.getMailZip()+"\","+
    "\""+contact.getMailCountry()+"\","+
    "\""+contact.getRegistrationType()+"\","+
    "\""+contact.getTitle()+"\""+"\\n\\";
    dsClient.importData(DATA_SET_ID, csvInput);

Best Answer

  • Member
    Answer ✓

    This is what works:

     

    1. csvInput +=
      "\""+contact.getFirstName()+"\","+
      "\""+contact.getLastName()+"\","+
      "\""+contact.getPhone()+"\","+
      "\""+contact.getCompany()+"\","+
      "\""+contact.getEmail()+"\","+
      "\""+contact.getID()+"\","+
      "\""+contact.getDegree()+"\","+
      "\""+contact.getBadge()+"\","+
      "\""+contact.getMailStreet1()+"\","+
      "\""+contact.getMailStreet2()+"\","+
      "\""+contact.getMailCity()+"\","+
      "\""+contact.getMailState()+"\","+
      "\""+contact.getMailZip()+"\","+
      "\""+contact.getMailCountry()+"\","+
      "\""+contact.getRegistrationType()+"\","+
      "\""+contact.getTitle()+"\"\n";

    Basically, each comma tells the API it's a new column.

    The less commas the better.

Answers

  • When I look in DOMO, on the data set page, I see this message:

    "The import has been cancelled because a new request has been submitted."

  • Member
    Answer ✓

    This is what works:

     

    1. csvInput +=
      "\""+contact.getFirstName()+"\","+
      "\""+contact.getLastName()+"\","+
      "\""+contact.getPhone()+"\","+
      "\""+contact.getCompany()+"\","+
      "\""+contact.getEmail()+"\","+
      "\""+contact.getID()+"\","+
      "\""+contact.getDegree()+"\","+
      "\""+contact.getBadge()+"\","+
      "\""+contact.getMailStreet1()+"\","+
      "\""+contact.getMailStreet2()+"\","+
      "\""+contact.getMailCity()+"\","+
      "\""+contact.getMailState()+"\","+
      "\""+contact.getMailZip()+"\","+
      "\""+contact.getMailCountry()+"\","+
      "\""+contact.getRegistrationType()+"\","+
      "\""+contact.getTitle()+"\"\n";

    Basically, each comma tells the API it's a new column.

    The less commas the better.

This discussion has been closed.