Skip to main content
Solved

TimeXtender Rest data source with CSV response

  • February 11, 2025
  • 8 replies
  • 81 views

Hi 

I have a REST data source that provides the desired output in CSV format. However, I'm looking for guidance on formatting the XML output to match the expected structure. Currently, the XML output I receive looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Name_of_table>
    <value> "name_of_column1","name_of_column2","name_of_column3","000: name_of_column4," "G name,with comma","2000M01","Volumindeks, kalenderjustert",. "G name,with comma","2000M02","Volumindeks, kalenderjustert",. "G name,with comma","2000M04","Volumindeks, kalenderjustert",3.2 "G name,with comma","2000M05","Volumindeks, kalenderjustert",50.2...  </value>
</Name_of_table>

Is there any support for CSV responses in the Rest Connector, or do you recommend creating a XSLT file for this purpose? 

Best answer by Thomas Lind

Hi ​@annfoss 

I made a setup based on this using the new 9.0.0.0 version of the REST provider.

If you remove the txt from the file you can import my setup and try it out.

I also added the RAW file converted to txt and the XML version to show the conversion that is done now.

Try it out, I think it looks correct for me. The only issue is for the _07129__Varehandelsindeksen_ field that contains a . when it is without a value. This means that it becomes a string instead of a decimal value.

 

View original
Did this topic help you find an answer to your question?

8 replies

rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • 649 replies
  • February 11, 2025

Hi,

if you are on the TDI release and have an updated TimeXtender REST connector you can specify the Data Format, one of the options there is CSV. See the documentation at the Data Format heading: 

 


  • Author
  • Participant
  • 14 replies
  • February 11, 2025

Hi ​@rory.smith. Thank you! However, I can’t get this setting to work. When I execute the “import metadata” I get “completed successfully” but no source tables. When I cache to path I get the same XML file as above.

 


rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • 649 replies
  • February 11, 2025

Hi,

I guess the option is meant for the format of the entire response- in your case it has CSV inside JSON. I guess that would require some XLST or similar.


  • Author
  • Participant
  • 14 replies
  • February 11, 2025

Hi ​@rory.smith. I don’t think I have a CSV inside a JSON. This is my output in postman. 

 

 


rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • 649 replies
  • February 11, 2025

<?xml version="1.0" encoding="UTF-8"?> <Name_of_table>     <value> "name_of_column1","name_of_column2","name_of_column3","000: name_of_column4," "G name,with comma","2000M01","Volumindeks, kalenderjustert",. "G name,with comma","2000M02","Volumindeks, kalenderjustert",. "G name,with comma","2000M04","Volumindeks, kalenderjustert",3.2 "G name,with comma","2000M05","Volumindeks, kalenderjustert",50.2... </value> </Name_of_table>

 

Your initial post indicates otherwise. I think Postman unwraps the JSON automatically, if you look at the real packets coming back (Console in Postman), you will likely see the CSV data is enclosed in a JSON structure.


  • Author
  • Participant
  • 14 replies
  • February 11, 2025

Hmm, I am pretty sure the output is on CSV format (I checked the console in postman). this is what TimeXtender give me when I don’t chooce the data format.

<?xml version="1.0" encoding="UTF-8"?>
<Name_of_table>
    <value> "name_of_column1","name_of_column2","name_of_column3","000: name_of_column4," "G name,with comma","2000M01","Volumindeks, kalenderjustert",. "G name,with comma","2000M02","Volumindeks, kalenderjustert",. "G name,with comma","2000M04","Volumindeks, kalenderjustert",3.2 "G name,with comma","2000M05","Volumindeks, kalenderjustert",50.2...  </value>
</Name_of_table>

It is an open source API: 

https://data.ssb.no/api/v0/no/table/07129

body: {"query":[{"code":"ContentsCode","selection":{"filter":"item","values":["VolumInVirkedag"]}}],"response":{"format":"csv2"}} 

 

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • Answer
  • March 7, 2025

Hi ​@annfoss 

I made a setup based on this using the new 9.0.0.0 version of the REST provider.

If you remove the txt from the file you can import my setup and try it out.

I also added the RAW file converted to txt and the XML version to show the conversion that is done now.

Try it out, I think it looks correct for me. The only issue is for the _07129__Varehandelsindeksen_ field that contains a . when it is without a value. This means that it becomes a string instead of a decimal value.

 


  • Author
  • Participant
  • 14 replies
  • March 7, 2025

Thank you, ​@Thomas Lind. Everything is working perfectly now.

For anyone facing similar issues, we resolved it by upgrading TimeXtender to ensure compatibility with the new version of the REST provider (9.0.0.0), which allows specifying the data format (CSV).

 

However, I don’t think this will be a further issue in TimeXtender Data Integration 6926.1 due to this improvement? ​@Thomas Lind 

When you upgrade to the new release, the Ingest service and data sources must be upgraded at the same time (i.e. you cannot upgrade the ingest service without upgrading data sources or vice versa).

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings