SAP Intelligent Robotic Process Automation: List Management


The purpose of the post is to explain, seek advise and robust solutions to the below Anomaly experienced when populating a List Variable in SAP Intelligent Robotic Process Automation.

Use case:

We are currently automating a propose by reading data from a 3rd party solution using a REST API.


Figure 1: Process Automation

  1. We have a Custom script embedded with the API logic
  2. Call web service element for the service call 
  3. Write to Json file element: which holds the returned results from the webservice 
  4. Read json file element: to read a specific field being the username within the json file
  5. For Each element: within the for each loop we read a specific field being the username into a list variable and an add item(List) element.
    • Custom script: Which declares an empty list then populates the list with usernames from the previously collected data which resides in the Read json file element step 4

SekhuteTK_0-1710925336010.pngFigure 2:Custom Script Logic

  • Add item(List): Which adds the collected names  in above custom script to the element.

The Above process successfully executes and iterates through the file as expected, However:

  1.  The List variable, Overwrites the entries populated at each iteration instead of appending 
  2. Furthermore,   the List variable holds the last name then populates null values.

Results from various iterations, we have also attached the list results to the post:




Kind Regards,

Scroll to Top