Skip to main content
Solved

ODX Read multiple json files from same directory


I’ve a location with multple different json files. Can i use one connector to this directory and transfer each json file, or need i to make one connector for each file?

 

For csv files i can use one connector, for json it doesn’t seem to work this way...

Best answer by rory.smith

Hi,

those would have separate structures and therefore need their own .rsd / metadata handling. If the structures nest into each other you might be able to use the MetaDataDiscoveryURI parameter. For XML you point this at an .xsd, I assume you somehow point it at a JSON Schema but have never tried this.

If you have separate files with no common schema, you will most likely need to generate separate .rsd for each table / file. In short: using GenerateSchemaFiles > OnUse, modify them to your needs, add the names of those schemas to Schema > Tables, set GenerateSchemaFiles to Never.

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

4 replies

rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • 649 replies
  • October 10, 2023

Hi @Pieter-Jan ,

as long as your files are local / cloud storage see: CData ADO.NET Provider for JSON - Establishing a Connection , “Set the URI to a single JSON file or a folder containing JSON files: C:\folder1. Note that specifying a folder results in a single aggregated table derived from all of the JSON files in the folder.”


  • Author
  • Explorer
  • 5 replies
  • October 10, 2023

The files have different format, so i guess this isn’t going to work.

 

for instance, customer.json and order.json in same directory.


rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • 649 replies
  • Answer
  • October 10, 2023

Hi,

those would have separate structures and therefore need their own .rsd / metadata handling. If the structures nest into each other you might be able to use the MetaDataDiscoveryURI parameter. For XML you point this at an .xsd, I assume you somehow point it at a JSON Schema but have never tried this.

If you have separate files with no common schema, you will most likely need to generate separate .rsd for each table / file. In short: using GenerateSchemaFiles > OnUse, modify them to your needs, add the names of those schemas to Schema > Tables, set GenerateSchemaFiles to Never.


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • October 18, 2023

Hi @Pieter-Jan 

Rory is correct, if they don’t all follow the format you will need RSD files. If you have multiple versions of each type you can merge them into one table for each type by adding an asterisk in the name for the part to merge. You just need to be sure it ends in .json or has it in the include files field.


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