Solved

Load csv from API

  • 14 April 2023
  • 4 replies
  • 69 views

I've got an API that returns JSON data. One of the fields contains a UUE encoded csv file. Is there a way to load this to the ODX without some external pre processing?

Thanks,

Gerrit

icon

Best answer by Thomas Lind 17 April 2023, 10:40

View original

4 replies

Userlevel 6
Badge +5

Hi Gerrit

I am not sure. You have a field where you can specify what encoding the file uses. There is a suggested option, but you are allowed to overwrite it with your own value.

Current.

LTS

So try to change it to UUE instead and see if it resolves the issue.

Thanks Thomas,

I've tried that, but when I'm using the csv provider I do not get data. At the moment I'm using the REST provider, so I can access the JSON stream. I've manipulated the rsd file like this from:

  <api:set attr="JSONPath" value="$" />

To
  <api:set attr="JSONPath" value="$.Data" />

Because my encoded csv data is in the Data key in JSON. But how to decode UUE (base64) and then show the csv columns?

In Postman my response looks like this:

If I use the REST or JSON provider, I am able to load the JSON to a SQL table from the ODX, but then I still would need to decode and somehow interpret the csv.

Userlevel 6
Badge +5

Hi Gerrit

The CSV provider can also do RSD files, similar to the REST provider.

However once you have text data in a field you can use string split options to make them back into SQL tables/fields.

I have a project for that, we used to have a so called bigfile data source, but I made it work for just a large CSV file as well.

Userlevel 6
Badge +5

Hi @gerrit.deglee did you manage to resolve the issue? If so could you please help us by marking the best answer above? Please let us know if you have any follow up questions 

Reply