DevOps and System Administration Discussions
Dive into SAP DevOps and system administration. Join discussions to collaborate on optimizing workflows, share knowledge, and leverage resources effectively.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Intelligent Robotic Process Automation: List Management

SekhuteTK
Participant
0 Kudos

Greetings,

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.

SekhuteTK_2-1710920520238.png

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:

SekhuteTK_3-1710923813943.png 

SekhuteTK_4-1710923844007.png

SekhuteTK_5-1710923868315.png

Kind Regards,

0 REPLIES 0