Skip to main content

I have issue with getting details from forms based on a list of forms

List of forms: https://api.goformz.com/v2/formz

Form details: https://api.goformz.com/v2/formz/formId

Both nested query and pagination works seperately, but I struggle to get it work with both of them. I have tried the solution in the linked case below, but I get stuck on the same place as the user in that case:

The query table is running for approximately correct time (which indicates it is reading the correct amount of data), but no data is going into the SQL-table.

The query is this simple: 

SELECT fields,formId FROM REST.Formz_DataPerForm
WHERE Nested_Id IN (SELECT formId FROM REST.formz_WithDateFilter)

Is it possible to get this working? 

 

 RSD list of forms:

<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="formz_WithDateFilter" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
<!-- You can modify the name, type, and column size here. -->
<attr name="formId" xs:type="string" readonly="false" other:xPath="/json/formId" />
<input name="rows@next" desc="Identifier for the next page of results. Do not set this value manually." />
</api:info>

<api:set attr="DataModel" value="DOCUMENT" />
<api:set attr="URI" value="https://api.goformz.com/v2/formz?filter=lastUpdatedDate%20ge%202024-11-09" />
<api:set attr="EnablePaging" value="TRUE" />
<api:set attr="pagenumberparam" value="pageNumber" />
<api:set attr="pagesizeparam" value="pageSize" />
<api:set attr="pagesize" value="100" />

<!--https://api.goformz.com/v2/formz?filter=lastUpdatedDate%20ge%202024-11-11&pageNumber=1&pageSize=2-->

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

<!-- 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:call op="jsonproviderGet">
<api:push/>
</api:call>
</api:script>

</api:script>

RSD Form details:

<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="Formz_DataPerForm" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1" other:queryslicercolumn="nested_id">
<!-- You can modify the name, type, and column size here. -->
<attr name="nested_id" xs:type="string" readonly="false" other:filter="{nested_id}" other:xPath="/json/nested_id" />
<attr name="formId" xs:type="string" readonly="false" other:xPath="/json/formId" />
<attr name="fields" xs:type="string" readonly="false" other:xPath="/json/fields" />
</api:info>

<api:set attr="DataModel" value="DOCUMENT" />
<api:set attr="URI" value="https://api.goformz.com/v2/formz/{nested_id}/" />
<api:match pattern="*nested_id*" type="glob" value=""_query.criteria]">
<api:else>
<api:set attr="URI" value="https://api.goformz.com/v2/formz/d7149786-2263-46d3-bbd8-a174f3890a67" />
</api:else>
</api:match>
<api:set attr="JSONPath" value="$." />

<!-- 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:call op="jsonproviderGet">
<api:push/>
</api:call>
</api:script>

</api:script>

 


Hi ​@jarle 

The default pagination options do not work when you use a nested call unfortunately.

I now see you aren’t doing a nested call but a query slicer.

Do you get an message like this?

 


Hi Thomas,

I tested nested call earlier, but couldn’t get it to work, so I tried the query slicer. I don’t get any error message, when running the query above. I just don’t get any rows.

If it is possible to do manual pagination somehow, that could also be a solution: There is some info about the pagination in the API here: https://developers.goformz.com/reference/pagination


Hi ​@jarle 

Yes, but it requires you to know what the last page is or what the max number of rows is in the endpoint.

It is hard to do a check for empty data otherwise continue operation in RSD files.

I can see that it returns the amount of rows like so.

{ "x-total-count": 737 }

If you can get this value in a call, you can run it in an enum by dividing with the page size.

You also need to use the round() feature to make sure it is a full number, but otherwise it can be used like I explain in the enum section.

Enum+and+page+method


Reply