We are deploying a bot via API and the dev team wants to pass in a nested dictionary, a list of dictionaries, so to speak. Is this possible? If not, can json be passed in a string variable and then the json action package parse out what we need?
Working with a nested dictionary

Best answer by Zaibi
Dear
Yes, it is possible to pass a nested dictionary (a list of dictionaries) as an argument when deploying a bot via the API in Automation Anywhere. You can do this by converting the nested dictionary to a JSON string and passing the string as an argument to the API.
To convert the nested dictionary to a JSON string, you can use the "Convert to JSON" action from the "JSON" package in Automation Anywhere. This action takes a dictionary or list as an input and returns a JSON string representation of the data.
Here is an example of how you might use the "Convert to JSON" action to pass a nested dictionary as an argument to the API:
-
Use the "Convert to JSON" action to convert the nested dictionary to a JSON string and store the result in a variable.
-
Use the "Call API" action to call the API and pass the JSON string as an argument.
-
Use the "Parse JSON" action from the "JSON" package to parse the JSON string and extract the data you need.
Alternatively, you could pass the nested dictionary directly as an argument to the API and use the "Parse JSON" action to parse the data on the server side. This would allow you to avoid the need to convert the data to a JSON string before calling the API.
Regards,
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.