Fetch More than 800 Records from SAP SuccessFactors Using the queryMore Operation in SFQL
If you need to fetch more than 800 records at a time from SAP SuccessFactors, use the queryMore
operation.
The SFQL query object retrieves the first 800 records from SAP SuccessFactors and creates a server-side querySessionId
. The
queryMore
(SFQL) call processes subsequent records in up to
800-record chunks and returns a newly-generated querySessionId
in the
SAP SuccessFactors response. To iterate through records in the result set, you generally call
queryMore
(SFQL) repeatedly until all records in the result set
have been processed (the hasMore
flag is true
). The
while loop is exited only after no more records are returned by the query when the
hasMore
flag is false
.
numResults
hasMore
querySessionId
-
numResults
: ThenumResults
variable contains the number of records retrieved from SAP SuccessFactors. -
hasMore
: ThehasMore
response is a boolean value. If it returnstrue
, there are more records available to fetch. If it returnsfalse
, there are no more records available to fetch. -
querySessionId
: ThequerySessionID
stores the value of the last record retrieved from SAP SuccessFactors. Initially, it has no value; the localquerySessionID
is initialized with empty single quotes (''
).
queryMore
operation in Oracle Integration:
-
Log in to Oracle Integration.
-
Create SOAP Adapter and SAP SuccessFactors Adapter connections.
-
Create an orchestrated integration.
-
Drag and drop an SOAP Adapter from the Triggers section to the trigger side and configure it.
-
Drag and drop an assign activity from the Actions section and create the following two variables:
-
$hasMore
----- hardcodehasMore
=“true”
-
$querySessionId
---- hardcode with an empty value
-
-
Drag and drop a while loop activity and specify the condition
hasMore =’true'
in the while loop. -
Drag and drop the SAP SuccessFactors Adapter inside the while loop and configure it with the following SFQL query. The query can be a normal or bind query.
Query : Select status from the user Bind Query : Select status from the user where status='&status'
-
Create a mapping between the SOAP AdapterSAP SuccessFactors Adapter and the SAP SuccessFactors Adapter with the variable that you created in the assign activity for
“hasMore”
.hasMore(Variable)----------> status (Query input parameter)
-
After request mapping is completed, drag and drop one more assign activity next to the SAP SuccessFactors Adapter inside the while loop, and assign the
queryMore
response to the variables that you created in the first assign activity as follows:$querySessionId ------> nsmpr2:querySessionId $hasMore---------------> nsmpr2:hasMore
-
Check the response received from SuccessFactors. The condition is first checked. If the condition is satisfied, the records are fetched.
-
If the
hasMore
value istrue
, then it enters into the while loop. -
If the
hasMore
value isfalse
, then the condition is not satisfied and the while loop is exited.
This completes the invoking of the
queryMore
operation in SuccessFactors. Further in your orchestration, you can add adapters and activities as per your business requirement. -