Hi @RobvdBrink
Let me just add that we have an internal case for this. If a solution is found, I will add it here.
Hi @RobvdBrink
Let me just add my findings and the current status of this issue.
Here is the response regarding if it was possible in the normal setup to do this.
Unfortunately, all the aggregated file related properties are for CSV files, not JSON since trying to aggregate JSON files dynamically would be significantly more complicated than with CSV files. I do think this should be possible in an RSD, likely with some kind of pseudo-column input for which dates/times you want to include and use of a nested set of enum blocks to loop through all the relevant URIs. One thing that may be an issue would be the exact names of the JSON files, looking through the ZIP example here, it seems like these files have randomly generated GUIDs as names, which would make it difficult to build the URI to that JSON file. If the files were instead named with a scheme that you could iterate through (something like file1.json, file2.json, etc.), that would probably help with the implementation in the RSD file.
I then made some RSD files.
This is how it ended up.
<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- See Column Definitions to specify column behavior and use XPaths to extract column values from JSON. -->
<api:info title="VehicleCombination" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<!-- You can modify the name, type, and column size here. -->
<attr name="VehicleId" xs:type="string" readonly="false" other:xPath="/json/Call/CallVisit/RoadVisit/VehicleCombinations/VehicleCombination/VehicleId"/>
</api:info>
<api:set attr="DataModel" value="DOCUMENT"/>
<api:set attr="baseURI" value="C:\\FlatFiles\\e-mergo\\Call\\1.2\\date={date}\\hr={hour}"/>
<api:set attr="JSONPath" value="$.Call.CallVisit.RoadVisit.VehicleCombinations.VehicleCombination"/>
<api:set attr="EnablePaging" value="True"/>
<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
<api:script method="GET">
<api:set attr="method" value="GET"/>
<api:set attr="dates" value="2024-10-25,2024-10-25,2024-10-26,2024-10-27,2024-10-28,2024-10-29,2024-10-30,2024-10-31"/>
<api:enum list="tdates]" separator=",">
<api:set attr="date" value="e_value]"/>
<api:set attr="URIDate" value="ebaseURI | replace('{date}', 'date])]" />
<api:enum range="0..23">
<api:set attr="hour" value="e_value | rjust(2, '0')]" />
<api:set attr="URI" value="eURIDate | replace('{hour}', 'hour])]" />
<api:call op="jsonproviderGet">
<api:catch code="500"></api:catch>
<api:push/>
</api:call>
</api:enum>
</api:enum>
</api:script>
</api:script>
However there is an issue with this.
I do not point at a specific file or have a third enum iterating over filenames as they are all randomly given GUIDS like this 2c2426e0-9737-496b-bd2d-0fad7b62a33b.json. When you do that looping does not work.
Here is the response from CData regarding this.
Unfortunately, we only support retrieving multiple files by pointing the URI to the folder containing them when you are not using paging. When you enable the user paging, it is expected that you will provide the URI to a specific file when making the jsonproviderGet call.
So for this setup, this file do not work, but if others find this question and have a similar issue it might.
You just need to point at a specific file not just a folder.