Hi I have a REST API that uses an item index as part of the URI, in the format https://<URL>/LocationPerilGroup/{PerilGroupID}.
So an example call might be https://<URL>/LocationPerilGroup/12.
This is a small lookup table and I was hoping that i could use an enum to repeatedly call the API while iterating through the list (40 items) to return the table to the ODX.
My enum does iterate, but I only get output from the first record.
Can this be done? Is there something I have missed? Please help.
RSD file content below:
Â
<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="locationPerilSets" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
  <!-- You can modify the name, type, and column size here. -->
  <attr name="LocationPerilSetsRecord_id"   xs:type="integer"  readonly="false"  key="true"  other:xPath="/json/locationPerilSets/_id"      />
  <attr name="locationPerilSetId"         xs:type="integer" readonly="false"        other:xPath="/json/locationPerilSets/id"      />
  <attr name="locations"              xs:type="string"  readonly="false"        other:xPath="/json/locationPerilSets/locations"   />
  <attr name="name"                 xs:type="string"  readonly="false"        other:xPath="/json/locationPerilSets/name"     />
  <attr name="perils"                xs:type="string"  readonly="false"        other:xPath="/json/locationPerilSets/perils"    />
 </api:info>
 <api:set attr="in.DataModel" value="RELATIONAL" />
 <api:set attr="in.JSONPath" value="$.locationPerilSets" />
 <api:set attr="in.URITemplate" value="https://someurl.net/api/REST/LocationPerilGroup/{perilset_id}"/>
 Â
 <!-- 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:enum range="6..10">
      <!-- t_value] -->
      <api:set attr="in.URI" value="=in.URITemplate| replace('{perilset_id}', =_value])]" />
      <!-- <api:call op="jsonproviderGet"> -->
      <api:call op="jsonproviderGet" in="in" out="PerilGroupOut">
         <api:set attr="out.LocationPerilSetsRecord_id"    value="rPerilGroupOut.LocationPerilSetsRecord_id | allownull()]"/>
         <api:set attr="out.locationPerilSetId"           value="iPerilGroupOut.locationPerilSetId | allownull()]"/>
         <api:set attr="out.locations"                value="aPerilGroupOut.locations | allownull()]"/>
         <api:set attr="out.name"                   value=" PerilGroupOut.name | allownull()]"/>
         <api:set attr="out.perils"                   value=" PerilGroupOut.perils | allownull()]"/>
         <api:push item="out"/>
      </api:call>
   </api:enum>
</api:script>
</api:script>
Â