Dynamic Record Count with HTTP GET Command + Iterator
回答済みI am using a HTTP Get command to make an API call to SAP OData service. We are attempting to pull a set of records for a specified accounting period. The API call is successful, but we are now running into an issue where the SAP OData service is limiting the number of records sent with each call, to 5,000. Theoretically, we have a solution for this problem. We are going to make an initial call to SAP using a GET command with $count included in our URL. Then we want to use the record count returned, as a dynamic variable in an iterator, so that we make "x" amount (where "x" = total record account / 5,000, rounded up) of API calls to SAP, to obtain the total number of records for the period. We would combine that dynamic variable with $skiptoken in a second GET command, to grab 5,000 records per API call, until "x" number of iterations have been completed. The one issue we have is that in our initial GET command using $count, the record count is coming through in the LOGS section of the command and not the OUTPUTS section, so we are unable to determine how to turn it into a dynamic variable. Can someone help us figure out how to take that record count from the LOGS section and turn it into a dynamic variable?
-
正式なコメント
Hi Thomas,
The HTTP Connector has two output types by default. The "response" and a "response header". One of the two objects has to contain your value; as the value cannot be materialized out of thin air. What you are describing is typical of the HTTP Connector since we cannot build around the endless possibilities it can be used for. What I would suggest to do is use an additional option called Dynamic Output to create the additional output you desire and pull that value from the RESPONSE.
Please take a look at the following article on Dynamic Outputs. You can use a simple RegEx command to get the value out of the RESPONSE file and put it into a custom variable of your choice. https://support.workiva.com/hc/en-us/articles/360046107791-Manage-dynamic-outputs-for-a-command
I would also suggest in the future a more suitable place for CHAINS discussions would be the following community path (Support Center > Community > Chains & Connectors): https://support.workiva.com/hc/en-us/community/topics/360001460472-Chains-Connectors
Thank you,
Wayneサインインしてコメントを残してください。
コメント
1件のコメント