How to Pass List Box Values Using the Gallery API
This article shows an example of how the available list box values can be retrieved and submitted together to /workflow/{appId}/jobs endpoint.
Prerequisites
Procedure
- Use /v1/workflows/{appId}/questions endpoint to get the questions from the app. Here is an example of a response:
[
{
"name": "List Box (11)",
"type": "QuestionListBox",
"description": "Select the value",
"items": [
{
"key": "TNG",
"value": "TNG"
},
{
"key": "STV",
"value": "STV"
},
{
"key": "TOS",
"value": "TOS"
},
{
"key": "DS9",
"value": "DS9"
},
{
"key": "STE",
"value": "STE"
}
],
"multiple": "True"
}
]
- To pass in the selected list box in one of the endpoints below, enter the values in the value name separated by a comma.
- /v1/workflows/{appId}/jobs
- /user/v2/workflows/{appId}/jobs
Here is an example:
{
"questions": [
{
"name": "List Box (11)",
"value": "'TNG', 'STV'"
}
]
}
NOTE: "TNG" and "STV" in the above examples are the values from the "value" name in Step 1.
Additional Resources