Skip to main content
Solved

How do I pass list, dictionary or datetime type variables as input to the Deploy Bot API?


Hi,

 

I'm trying to deploy bots with input parameters using Automation Anywhere API. I've successfully managed to pass string, number and boolean variables to the bot, but I can't seem to figure out what is the correct json syntax to pass dictionaries, list or datetime variables. I've looked for it in the swagger (https://dev-damantia.my.automationanywhere.digital/swagger/) but can't find information about it

 

I'm using the Postman collection provided by @MICAH SMITH​  in this video https://youtu.be/UZJ68r64oxA

 

Here is what I'v tried so far:

-List:

{

  "fileId": *****, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "lInput1": {

      "type": "LIST", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "list": ["Value11","Value12"] //key must match type, in this case string

    },

    "lInput2": {

      "type": "LIST",

      "list": ["Value21","Value22"] //key must match type, in this case string

    }

  }

 

-Dictionary:

{

  "fileId": ******, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "dInput1": {

      "type": "DICTIONARY", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "dictionary": [{"Key1":"Value1"}] //key must match type, in this case string

    },

    "dInput2": {

      "type": "DICTIONARY",

      "dictionary": [{"Key2":"Value2"}] //key must match type, in this case string

    }

  }

}

 

-Datetime:

 

{

  "fileId": *******, //id of the bot to execute

  "runAsUserIds": [

    *** //id(s) of the user account to run the bot - must have default device unless specified below

  ],

  "poolIds": [],

  "overrideDefaultDevice": false,

  "callbackInfo": {

    "url": "https://callbackserver.com/storeBotExecutionStatus", //Callback URL - not required, but can be used - can be removed if no callback needed

    "headers": {

      "X-Authorization": "{{token}}" //Callback API headers. Headers may contain authentication token, content type etc. Both key & value are of type string.

    }

  },

  "BotInput": { //optional values to map to the bot...NOTE: These values must match the exact variable names and must be defined as input values

    "dtInput1": {

      "type": "DATETIME", //Type can be [ STRING, NUMBER, BOOLEAN, LIST, DICTIONARY, DATETIME ]

      "datetime": "03/02/1999" //key must match type, in this case string

    },

    "dtInput2": {

      "type": "DATETIME",

      "datetime": "03/05/1999" //key must match type, in this case string

    }

  }

}

 

With all these API requests the bot is being deployed, but it is receiving empty variables. What should be the correct json syntax for these data types?

 

Thank you

Best answer by Sumit.K7

@Eduardo Martínez Hernández​ Refer below sample:

"botInput": {

        "dict_input": {

            "type": "DICTIONARY",

            "dictionary": [

                {

                    "key": "key1",

                    "value": {

                        "type": "STRING",

                        "string": "value1"

                    }

                },

                {

                    "key": "key2",

                    "value": {

                        "type": "STRING",

                        "string": "value2"

                    }

                }

            ]

        },

        "list_input": {

            "type": "LIST",

            "list": [

                {

                    "type": "NUMBER",

                    "number": "123"

                },

                {

                    "type": "STRING",

                    "string": "liststring"

                }

            ]

        },

        "dt_input": {

            "type": "DATETIME",

            "string": "2022-03-22T00:15:00+05:30[Asia/Calcutta]"

        }

    }

View original
Did this topic help answer your question?

12 replies

Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 142 replies
  • Answer
  • March 22, 2022

@Eduardo Martínez Hernández​ Refer below sample:

"botInput": {

        "dict_input": {

            "type": "DICTIONARY",

            "dictionary": [

                {

                    "key": "key1",

                    "value": {

                        "type": "STRING",

                        "string": "value1"

                    }

                },

                {

                    "key": "key2",

                    "value": {

                        "type": "STRING",

                        "string": "value2"

                    }

                }

            ]

        },

        "list_input": {

            "type": "LIST",

            "list": [

                {

                    "type": "NUMBER",

                    "number": "123"

                },

                {

                    "type": "STRING",

                    "string": "liststring"

                }

            ]

        },

        "dt_input": {

            "type": "DATETIME",

            "string": "2022-03-22T00:15:00+05:30[Asia/Calcutta]"

        }

    }


Hello, @Sumit Kumar​ 

 

Thank you very much, I've tested it out and it works!

 

Cound you help with record/table format as well? I can't find the right way to set the schema

 

Thank you very much


Forum|alt.badge.img+11

jamesmillere
Forum|alt.badge.img

Hi,

I have been through your Query and to pass dictionaries, lists, and datetime variables as input parameters to Automation Anywhere bots using the Automation Anywhere API, you need to modify the JSON syntax in your API requests.

Follow these correct syntax for each data type-

  1. List
"BotInput": {
  "lInput1": {
    "type": "LIST",
    "list": ["Value11", "Value12"]
  },
  "lInput2": {
    "type": "LIST",
    "list": ["Value21", "Value22"]
  }
}
  1. Dictionary
"BotInput": {
  "dInput1": {
    "type": "DICTIONARY",
    "dictionary": {
      "Key1": "Value1"
    }
  },
  "dInput2": {
    "type": "DICTIONARY",
    "dictionary": {
      "Key2": "Value2"
    }
  }
}
  1. Datetime
"BotInput": {
  "dtInput1": {
    "type": "DATETIME",
    "datetime": "1999-03-02T00:00:00Z"
  },
  "dtInput2": {
    "type": "DATETIME",
    "datetime": "1999-03-05T00:00:00Z"
  }
}

Make sure to adjust the datetime format to match the expected format by the Automation Anywhere bot.

With these correct syntaxes, you will be able to pass dictionaries, lists, and datetime variables successfully to your bots via the Automation Anywhere API.

 

 


Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 23 replies
  • September 25, 2024

Does anyone know how to pass value to a credential variable?


Forum|alt.badge.img

Hello @Automation Anywhere Team , I want to read the botInput parameters from the AA API in Automation anywhere bot.

 

"botInput": {

        "iTestList": {

            "type": "DICTIONARY",

            "dictionary": [

                {

                    "key": "test",

                    "value": {

                        "type": "STRING",

                        "string": "ok"

                    }

                }

            ]

        }

    }


Forum|alt.badge.img+2

Any Idea about API deployment Bot Input as table ?

---------------------------------------------

Bot Variable is :

Name : "itbl_Materials"

Type: TABLE

Argument Type: input

--------------------------------------------------

JSON Structure:


"botInput": {
        "itbl_Materials": {
            "type": "TABLE",
            "TABLE": [
                {
                    "name": "Material",
                    "type": "STRING"
                },
                {
                    "name": "IdsMaterial",
                    "type": "STRING"
                }
            ],
            "rows": [
                {
                    "values": [
                        {
                            "type": "STRING",
                            "string": "Material1"
                        },
                        {
                            "type": "STRING",
                            "string": "01"
                        }
                    ]
                }
            ]
        }
    }

 

Issue is deployement Sucess But inputs are not mapping with the variable "itbl_Materials”. Please help me with the solution.

 

Thanks in Advance,


Shreya.Kumar
Pathfinder Community Team
Forum|alt.badge.img+9
  • Pathfinder Community Team
  • 71 replies
  • March 3, 2025

Mohammad Ali.T wrote:

Any Idea about API deployment Bot Input as table ?

---------------------------------------------

Bot Variable is :

Name : "itbl_Materials"

Type: TABLE

Argument Type: input

--------------------------------------------------

JSON Structure:


"botInput": {
        "itbl_Materials": {
            "type": "TABLE",
            "TABLE": [
                {
                    "name": "Material",
                    "type": "STRING"
                },
                {
                    "name": "IdsMaterial",
                    "type": "STRING"
                }
            ],
            "rows": [
                {
                    "values": [
                        {
                            "type": "STRING",
                            "string": "Material1"
                        },
                        {
                            "type": "STRING",
                            "string": "01"
                        }
                    ]
                }
            ]
        }
    }

 

Issue is deployement Sucess But inputs are not mapping with the variable "itbl_Materials”. Please help me with the solution.

 

Thanks in Advance,

@Mohammad Ali.T could you double check that the input variable created in the taskbot is of type Table?


Forum|alt.badge.img+2

Hi ​@Shreya.Kumar ​

Yeah, I'm double sure about the

Name,

Data Type,

Argument type

everything is as expected. I can able to map the string variable except table.


Shreya.Kumar
Pathfinder Community Team
Forum|alt.badge.img+9
  • Pathfinder Community Team
  • 71 replies
  • March 10, 2025

@Mohammad Ali.T As a workaround, can you convert the table into JSON and pass it as a string?


Theodore Xypteras
Forum|alt.badge.img+5

Theodore Xypteras
Forum|alt.badge.img+5
shruti 7152 wrote:

Does anyone know how to pass value to a credential variable?

according to the v4 deploy swagger reference, you need to pass a credential vault reference instead of the credential itself: 

CredentialObject{

name string
lockerName string
attributeName string

}


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings